Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 22 for FromAPIVersionAndKind (0.3 sec)

  1. staging/src/k8s.io/apimachinery/pkg/runtime/schema/group_version.go

    		return "", ""
    	}
    	return gvk.GroupVersion().String(), gvk.Kind
    }
    
    // FromAPIVersionAndKind returns a GVK representing the provided fields for types that
    // do not use TypeMeta. This method exists to support test types and legacy serializations
    // that have a distinct group and kind.
    // TODO: further reduce usage of this method.
    func FromAPIVersionAndKind(apiVersion, kind string) GroupVersionKind {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 30 09:08:59 UTC 2023
    - 10.2K bytes
    - Viewed (0)
  2. pkg/controller/garbagecollector/operations.go

    // namespace> tuple to a unversioned.APIResource struct.
    func (gc *GarbageCollector) apiResource(apiVersion, kind string) (schema.GroupVersionResource, bool, error) {
    	fqKind := schema.FromAPIVersionAndKind(apiVersion, kind)
    	mapping, err := gc.restMapper.RESTMapping(fqKind.GroupKind(), fqKind.Version)
    	if err != nil {
    		return schema.GroupVersionResource{}, false, newRESTMappingError(kind, apiVersion)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 08 13:37:56 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/meta.go

    }
    
    // GroupVersionKind satisfies the ObjectKind interface for all objects that embed TypeMeta
    func (obj *TypeMeta) GroupVersionKind() schema.GroupVersionKind {
    	return schema.FromAPIVersionAndKind(obj.APIVersion, obj.Kind)
    }
    
    func (obj *ListMeta) GetListMeta() ListInterface { return obj }
    
    func (obj *ObjectMeta) GetObjectMeta() Object { return obj }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 05 20:12:50 UTC 2022
    - 7.7K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/runtime/testing/types.go

    	obj.APIVersion, obj.ObjectKind = gvk.ToAPIVersionAndKind()
    }
    func (obj *MyWeirdCustomEmbeddedVersionKindField) GroupVersionKind() schema.GroupVersionKind {
    	return schema.FromAPIVersionAndKind(obj.APIVersion, obj.ObjectKind)
    }
    
    func (obj *TestType2) GetObjectKind() schema.ObjectKind         { return schema.EmptyObjectKind }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  5. pkg/controller/podautoscaler/metrics/client.go

    func (c *customMetricsClient) GetObjectMetric(metricName string, namespace string, objectRef *autoscaling.CrossVersionObjectReference, metricSelector labels.Selector) (int64, time.Time, error) {
    	gvk := schema.FromAPIVersionAndKind(objectRef.APIVersion, objectRef.Kind)
    	var metricValue *customapi.MetricValue
    	var err error
    	if gvk.Kind == "Namespace" && gvk.Group == "" {
    		// handle namespace separately
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Feb 16 20:17:52 UTC 2023
    - 7.8K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go

    	}
    	return nil
    }
    
    func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList {
    	allErrs := field.ErrorList{}
    	gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind)
    	// gvk.Group is empty for the legacy group.
    	if len(gvk.Version) == 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 07 03:12:31 UTC 2022
    - 12K bytes
    - Viewed (0)
  7. pkg/registry/core/serviceaccount/storage/token.go

    		}
    	}
    
    	var (
    		pod    *api.Pod
    		node   *api.Node
    		secret *api.Secret
    	)
    
    	if ref := req.Spec.BoundObjectRef; ref != nil {
    		var uid types.UID
    
    		gvk := schema.FromAPIVersionAndKind(ref.APIVersion, ref.Kind)
    		switch {
    		case gvk.Group == "" && gvk.Kind == "Pod":
    			newCtx := newContext(ctx, "pods", ref.Name, namespace, gvk)
    			podObj, err := r.pods.Get(newCtx, ref.Name, &metav1.GetOptions{})
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 05 10:24:31 UTC 2024
    - 10K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/test/api_meta_meta_test.go

    	obj.TypeMeta.APIVersion, obj.TypeMeta.Kind = gvk.ToAPIVersionAndKind()
    }
    func (obj *MyAPIObject) GroupVersionKind() schema.GroupVersionKind {
    	return schema.FromAPIVersionAndKind(obj.TypeMeta.APIVersion, obj.TypeMeta.Kind)
    }
    func (obj *MyAPIObject) DeepCopyObject() runtime.Object {
    	panic("MyAPIObject does not support DeepCopy")
    }
    
    type MyIncorrectlyMarkedAsAPIObject struct{}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 14 10:11:56 UTC 2022
    - 12.9K bytes
    - Viewed (0)
  9. pkg/controller/podautoscaler/metrics/client_test.go

    				mapper := testrestmapper.TestOnlyStaticRESTMapper(legacyscheme.Scheme)
    				assert.NotNil(t, tc.singleObject, "should have only requested a single-object metric when we asked for metrics for a single object")
    				gk := schema.FromAPIVersionAndKind(tc.singleObject.APIVersion, tc.singleObject.Kind).GroupKind()
    				mapping, err := mapper.RESTMapping(gk)
    				if err != nil {
    					return true, nil, fmt.Errorf("unable to get mapping for %s: %v", gk.String(), err)
    				}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Nov 09 02:34:54 UTC 2021
    - 16.4K bytes
    - Viewed (0)
  10. pkg/kube/inject/inject.go

    func FromRawToObject(raw []byte) (runtime.Object, error) {
    	var typeMeta metav1.TypeMeta
    	if err := yaml.Unmarshal(raw, &typeMeta); err != nil {
    		return nil, err
    	}
    
    	gvk := schema.FromAPIVersionAndKind(typeMeta.APIVersion, typeMeta.Kind)
    	obj, err := injectScheme.New(gvk)
    	if err != nil {
    		return nil, err
    	}
    	if err = yaml.Unmarshal(raw, obj); err != nil {
    		return nil, err
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 31 20:35:11 UTC 2024
    - 28.8K bytes
    - Viewed (0)
Back to top