Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for NewAttributesRecord (0.41 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/plugin/namespace/lifecycle/admission_test.go

    		t.Errorf("unexpected error initializing handler: %v", err)
    	}
    
    	stopCh := make(chan struct{})
    	defer close(stopCh)
    
    	informerFactory.Start(stopCh)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  2. plugin/pkg/admission/serviceaccount/admission_test.go

    		if handler.Handles(op) {
    			t.Errorf("Expected not to handle operation %s", op)
    		}
    	}
    }
    
    func TestIgnoresNonPodResource(t *testing.T) {
    	pod := &api.Pod{}
    	attrs := admission.NewAttributesRecord(pod, nil, api.Kind("Pod").WithVersion("version"), "myns", "myname", api.Resource("CustomResource").WithVersion("version"), "", admission.Create, &metav1.CreateOptions{}, false, nil)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 12 17:49:30 UTC 2024
    - 36.9K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook_test.go

    	}{
    		{
    			name:        "no rules (just write)",
    			webhook:     &v1.ValidatingWebhook{NamespaceSelector: &metav1.LabelSelector{}, Rules: []v1.RuleWithOperations{}},
    			attrs:       admission.NewAttributesRecord(nil, nil, gvk("apps", "v1", "Deployment"), "ns", "name", gvr("apps", "v1", "deployments"), "", admission.Create, &metav1.CreateOptions{}, false, nil),
    			expectCall:  false,
    			matchResult: true,
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 28 19:30:04 UTC 2023
    - 32K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching_test.go

    	}{
    		{
    			name:          "no rules (just write)",
    			criteria:      &v1.MatchResources{NamespaceSelector: &metav1.LabelSelector{}, ResourceRules: []v1.NamedRuleWithOperations{}},
    			attrs:         admission.NewAttributesRecord(nil, nil, gvk("apps", "v1", "Deployment"), "ns", "name", gvr("apps", "v1", "deployments"), "", admission.Create, &metav1.CreateOptions{}, false, nil),
    			expectMatches: false,
    		},
    		{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 38.2K bytes
    - Viewed (0)
  5. 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)
  6. plugin/pkg/admission/imagepolicy/admission_test.go

    			if err != nil {
    				t.Errorf("%s: failed to create client: %v", tt.test, err)
    				return
    			}
    			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{})
    
    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. staging/src/k8s.io/apiserver/pkg/admission/metrics/metrics_test.go

    )
    
    var (
    	kind     = schema.GroupVersionKind{Group: "kgroup", Version: "kversion", Kind: "kind"}
    	resource = schema.GroupVersionResource{Group: "rgroup", Version: "rversion", Resource: "resource"}
    	attr     = admission.NewAttributesRecord(nil, nil, kind, "ns", "name", resource, "subresource", admission.Create, &metav1.CreateOptions{}, false, nil)
    )
    
    func TestObserveAdmissionStep(t *testing.T) {
    	defer Metrics.reset()
    	defer legacyregistry.Reset()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jul 14 17:01:37 UTC 2023
    - 16.9K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/rules/rules_test.go

    }
    type tests map[string]ruleTest
    
    func a(group, version, resource, subresource, name string, operation admission.Operation, operationOptions runtime.Object) admission.Attributes {
    	return admission.NewAttributesRecord(
    		nil, nil,
    		schema.GroupVersionKind{Group: group, Version: version, Kind: "k" + resource},
    		"ns", name,
    		schema.GroupVersionResource{Group: group, Version: version, Resource: resource}, subresource,
    		operation,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 25 23:28:16 UTC 2022
    - 13.8K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/delete.go

    		span.AddEvent("About to delete object from database")
    		wasDeleted := true
    		userInfo, _ := request.UserFrom(ctx)
    		staticAdmissionAttrs := admission.NewAttributesRecord(nil, nil, scope.Kind, namespace, name, scope.Resource, scope.Subresource, admission.Delete, options, dryrun.IsDryRun(options.DryRun), userInfo)
    		result, err := finisher.FinishRequest(ctx, func() (runtime.Object, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 01 10:00:32 UTC 2023
    - 11.4K bytes
    - Viewed (0)
  10. plugin/pkg/admission/podtolerationrestriction/admission_test.go

    			pod := test.pod
    			pod.Spec.Tolerations = test.podTolerations
    			err = admissiontesting.WithReinvocationTesting(t, 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)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 16K bytes
    - Viewed (0)
Back to top