Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 55 for NewAttributesRecord (0.21 sec)

  1. plugin/pkg/admission/alwayspullimages/admission_test.go

    				{Name: "ctr3", Image: "image", ImagePullPolicy: api.PullIfNotPresent},
    				{Name: "ctr4", Image: "image", ImagePullPolicy: api.PullAlways},
    			},
    		},
    	}
    	err := handler.Admit(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 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 30 22:59:57 UTC 2020
    - 8.5K bytes
    - Viewed (0)
  2. plugin/pkg/admission/priority/admission_test.go

    		if err := addPriorityClasses(ctrl, test.existingClasses); err != nil {
    			t.Errorf("Test %q: unable to add object to informer: %v", test.name, err)
    		}
    		// Now add the new class.
    		attrs := admission.NewAttributesRecord(
    			test.newClass,
    			nil,
    			scheduling.Kind("PriorityClass").WithVersion("version"),
    			"",
    			"",
    			scheduling.Resource("priorityclasses").WithVersion("version"),
    			"",
    			test.operation,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 03 18:43:48 UTC 2022
    - 21.2K bytes
    - Viewed (0)
  3. plugin/pkg/admission/security/podsecurity/admission_test.go

    		"enforce-warn-audit-baseline", "warn-baseline-audit-restricted",
    	}
    	for _, namespace := range namespaces {
    		b.Run(namespace+"_pod", func(b *testing.B) {
    			ctx := context.Background()
    			attrs := admission.NewAttributesRecord(
    				corePod.DeepCopy(), nil,
    				schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Pod"},
    				namespace, "mypod",
    				schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"},
    				"",
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 15 01:29:47 UTC 2022
    - 10.7K bytes
    - Viewed (0)
  4. plugin/pkg/admission/namespace/exists/admission_test.go

    	if err != nil {
    		t.Errorf("unexpected error initializing handler: %v", err)
    	}
    	informerFactory.Start(wait.NeverStop)
    
    	pod := newPod(namespace)
    	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 {
    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/runtimeclass/admission_test.go

    			expectError: false,
    			expectedPod: nil,
    		},
    	}
    
    	for _, tc := range tests {
    		t.Run(tc.name, func(t *testing.T) {
    
    			attrs := admission.NewAttributesRecord(tc.pod, nil, core.Kind("Pod").WithVersion("version"), tc.pod.Namespace, tc.pod.Name, core.Resource("pods").WithVersion("version"), "", admission.Create, &metav1.CreateOptions{}, false, &user.DefaultInfo{})
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 17 01:30:14 UTC 2022
    - 17.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/update.go

    						return newObj, mutatingAdmission.Admit(ctx, admission.NewAttributesRecord(newObj, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Create, updateToCreateOptions(options), dryrun.IsDryRun(options.DryRun), userInfo), scope)
    					}
    				} else {
    					if mutatingAdmission.Handles(admission.Update) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 20:19:46 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/admission/chain_test.go

    			accept: false,
    		},
    	}
    	for _, test := range tests {
    		t.Logf("testcase = %s", test.name)
    		// call admit and check that validate was not called at all
    		err := test.chain.Admit(context.TODO(), NewAttributesRecord(nil, nil, schema.GroupVersionKind{}, test.ns, "", schema.GroupVersionResource{}, "", test.operation, test.options, false, nil), nil)
    		accepted := (err == nil)
    		if accepted != test.accept {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 20 15:11:00 UTC 2019
    - 5.4K bytes
    - Viewed (0)
  8. plugin/pkg/admission/limitranger/admission_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 51.5K bytes
    - Viewed (0)
  9. plugin/pkg/admission/deny/admission_test.go

    	api "k8s.io/kubernetes/pkg/apis/core"
    )
    
    func TestAdmission(t *testing.T) {
    	handler := admissiontesting.WithReinvocationTesting(t, NewAlwaysDeny().(*alwaysDeny))
    	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 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 20 15:11:00 UTC 2019
    - 1.5K bytes
    - Viewed (0)
  10. plugin/pkg/admission/antiaffinity/admission_test.go

    						},
    					},
    				},
    			},
    			errorExpected: true,
    		},
    	}
    	for _, test := range tests {
    		pod.Spec.Affinity = test.affinity
    		err := handler.Validate(context.TODO(), admission.NewAttributesRecord(&pod, nil, api.Kind("Pod").WithVersion("version"), "foo", "name", api.Resource("pods").WithVersion("version"), "", "ignored", nil, false, nil), nil)
    
    		if test.errorExpected && err == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 20 15:11:00 UTC 2019
    - 7.9K bytes
    - Viewed (0)
Back to top