Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for FromAPIVersionAndKind (0.7 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/managedfields/fieldmanager_test.go

    	tests := []struct {
    		gvk schema.GroupVersionKind
    		obj []byte
    	}{
    		{
    			gvk: schema.FromAPIVersionAndKind("v1", "Pod"),
    			obj: getObjectBytes("pod.yaml"),
    		},
    		{
    			gvk: schema.FromAPIVersionAndKind("v1", "Node"),
    			obj: getObjectBytes("node.yaml"),
    		},
    		{
    			gvk: schema.FromAPIVersionAndKind("v1", "Endpoints"),
    			obj: getObjectBytes("endpoints.yaml"),
    		},
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 16 20:03:48 UTC 2023
    - 32.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/managedfieldsupdater_test.go

    	"sigs.k8s.io/yaml"
    )
    
    func TestManagedFieldsUpdateDoesModifyTime(t *testing.T) {
    	var err error
    	f := managedfieldstest.NewTestFieldManager(fakeTypeConverter, schema.FromAPIVersionAndKind("v1", "ConfigMap"))
    
    	err = updateObject(f, "fieldmanager_test", []byte(`{
    		"apiVersion": "v1",
    		"kind": "ConfigMap",
    		"metadata": {
    			"name": "configmap"
    		},
    		"data": {
    			"key": "value"
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 08 21:44:00 UTC 2023
    - 13.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/lastappliedmanager_test.go

    // created with the client-side apply last-applied annotation
    // will not give conflicts
    func TestApplyUsingLastAppliedAnnotation(t *testing.T) {
    	f := managedfieldstest.NewTestFieldManager(fakeTypeConverter, schema.FromAPIVersionAndKind("apps/v1", "Deployment"))
    
    	tests := []testArgs{
    		{
    			fieldManager: "kubectl",
    			lastApplied: []byte(`
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: my-deployment
    spec:
      replicas: 3
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 08 21:44:00 UTC 2023
    - 20K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/managedfields/internal/capmanagers_test.go

    	panic("not implemented")
    }
    
    func TestCapManagersManagerMergesEntries(t *testing.T) {
    	f := internaltesting.NewTestFieldManagerImpl(fakeTypeConverter, schema.FromAPIVersionAndKind("v1", "Pod"),
    		"",
    		func(m internal.Manager) internal.Manager {
    			return internal.NewCapManagersManager(m, 3)
    		})
    
    	podWithLabels := func(labels ...string) runtime.Object {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 08 21:44:00 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top