Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 320 for createActions (1.89 sec)

  1. staging/src/k8s.io/apiextensions-apiserver/test/integration/conversion/conversion_test.go

    	marker, err := ctc.versionedClient("marker", "v1beta1").Create(context.TODO(), newConversionMultiVersionFixture("marker", "marker", "v1beta1"), metav1.CreateOptions{})
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	for _, test := range tests {
    		t.Run(test.group, func(t *testing.T) {
    			upCh, handler := closeOnCall(test.handler)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 06 05:32:34 UTC 2023
    - 47.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiextensions-apiserver/test/integration/pruning_test.go

    	unstructured.SetNestedField(foo.Object, "bar", "metadata", "unspecified")
    	unstructured.SetNestedField(foo.Object, "bar", "metadata", "labels", "foo")
    	foo, err = fooClient.Create(context.TODO(), foo, metav1.CreateOptions{})
    	if err != nil {
    		t.Fatalf("Unable to create CR: %v", err)
    	}
    	t.Logf("CR created: %#v", foo.UnstructuredContent())
    
    	if _, found, _ := unstructured.NestedFieldNoCopy(foo.Object, "unspecified"); found {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 03 06:51:04 UTC 2023
    - 19.6K bytes
    - Viewed (0)
  3. plugin/pkg/admission/admit/admission_test.go

    	err := handler.Admit(context.TODO(), admission.NewAttributesRecord(nil, nil, api.Kind("kind").WithVersion("version"), "namespace", "name", api.Resource("resource").WithVersion("version"), "subresource", admission.Create, &metav1.CreateOptions{}, false, nil), nil)
    	if err != nil {
    		t.Errorf("Unexpected error returned from admission handler")
    	}
    }
    
    func TestAdmissionNilAttribute(t *testing.T) {
    	handler := NewAlwaysAdmit()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 20 15:11:00 UTC 2019
    - 1.8K bytes
    - Viewed (0)
  4. plugin/pkg/admission/namespace/exists/admission_test.go

    	err = handler.Validate(context.TODO(), admission.NewAttributesRecord(&pod, nil, api.Kind("Pod").WithVersion("version"), pod.Namespace, pod.Name, api.Resource("pods").WithVersion("version"), "", admission.Create, &metav1.CreateOptions{}, false, nil), nil)
    	if err != nil {
    		t.Errorf("unexpected error returned from admission handler")
    	}
    }
    
    // TestAdmissionNamespaceDoesNotExist verifies pod is not admitted if namespace does not exist.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  5. plugin/pkg/admission/deny/admission_test.go

    	err := handler.Admit(context.TODO(), admission.NewAttributesRecord(nil, nil, api.Kind("kind").WithVersion("version"), "namespace", "name", api.Resource("resource").WithVersion("version"), "subresource", admission.Create, &metav1.CreateOptions{}, false, nil), nil)
    	if err == nil {
    		t.Error("Expected error returned from admission handler")
    	}
    }
    
    func TestHandles(t *testing.T) {
    	handler := NewAlwaysDeny()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 20 15:11:00 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  6. plugin/pkg/admission/imagepolicy/admission_test.go

    			pod := goodPod(strconv.Itoa(rand.Intn(1000)))
    			attr := admission.NewAttributesRecord(pod, nil, api.Kind("Pod").WithVersion("version"), "namespace", "", api.Resource("pods").WithVersion("version"), "", admission.Create, &metav1.CreateOptions{}, false, &user.DefaultInfo{})
    
    			// Allow all and see if we get an error.
    			service.Allow()
    
    			err = wh.Validate(context.TODO(), attr, nil)
    			if tt.wantAllowed {
    				if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 02 06:05:06 UTC 2023
    - 32.9K bytes
    - Viewed (0)
  7. pkg/controlplane/reconcilers/helpers_test.go

    	errors := []error{}
    
    	updates := []k8stesting.UpdateAction{}
    	creates := []k8stesting.CreateAction{}
    	for _, action := range fakeClient.Actions() {
    		if action.GetVerb() == "update" {
    			updates = append(updates, action.(k8stesting.UpdateAction))
    		} else if action.GetVerb() == "create" {
    			creates = append(creates, action.(k8stesting.CreateAction))
    		}
    	}
    
    	if len(creates) != len(expectedCreates) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 27 12:46:23 UTC 2022
    - 4K bytes
    - Viewed (0)
  8. pkg/registry/core/serviceaccount/storage/storage_test.go

    	// add the namespace to the context as it is required
    	ctx = request.WithNamespace(ctx, serviceAccount.Namespace)
    	_, err := storage.Store.Create(ctx, serviceAccount, rest.ValidateAllObjectFunc, &metav1.CreateOptions{})
    	if err != nil {
    		t.Fatalf("failed creating test service account: %v", err)
    	}
    
    	// create an audit context to allow recording audit information
    	ctx = audit.WithAuditContext(ctx)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  9. plugin/pkg/admission/podnodeselector/admission_test.go

    		err := handler.Admit(context.TODO(), admission.NewAttributesRecord(pod, nil, api.Kind("Pod").WithVersion("version"), "testNamespace", namespace.ObjectMeta.Name, api.Resource("pods").WithVersion("version"), "", admission.Create, &metav1.CreateOptions{}, false, nil), nil)
    		if test.admit && err != nil {
    			t.Errorf("Test: %s, expected no error but got: %s", test.testName, err)
    		} else if !test.admit && err == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 8K bytes
    - Viewed (0)
  10. pkg/scheduler/framework/plugins/dynamicresources/dynamicresources_test.go

    	var resourceVersionCounter int
    	var mutex sync.Mutex
    
    	return func(action cgotesting.Action) (handled bool, ret apiruntime.Object, err error) {
    		createAction, ok := action.(cgotesting.CreateAction)
    		if !ok {
    			return false, nil, nil
    		}
    		obj, ok := createAction.GetObject().(metav1.Object)
    		if !ok {
    			return false, nil, nil
    		}
    
    		mutex.Lock()
    		defer mutex.Unlock()
    		switch action.GetVerb() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 27 07:57:10 UTC 2024
    - 61.9K bytes
    - Viewed (0)
Back to top