Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for NewAttributesRecord (0.89 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/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)
  4. 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)
  5. 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)
  6. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/validating/validator_test.go

    }
    
    func TestValidate(t *testing.T) {
    	ignore := v1.Ignore
    	fail := v1.Fail
    
    	forbiddenReason := metav1.StatusReasonForbidden
    	unauthorizedReason := metav1.StatusReasonUnauthorized
    
    	fakeAttr := admission.NewAttributesRecord(nil, nil, schema.GroupVersionKind{}, "default", "foo", schema.GroupVersionResource{}, "", admission.Create, nil, false, nil)
    	fakeVersionedAttr, _ := admission.NewVersionedAttributes(fakeAttr, schema.GroupVersionKind{}, nil)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 24.7K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/patch.go

    		staticCreateAttributes := admission.NewAttributesRecord(
    			nil,
    			nil,
    			scope.Kind,
    			namespace,
    			name,
    			scope.Resource,
    			scope.Subresource,
    			admission.Create,
    			patchToCreateOptions(options),
    			dryrun.IsDryRun(options.DryRun),
    			userInfo)
    		staticUpdateAttributes := admission.NewAttributesRecord(
    			nil,
    			nil,
    			scope.Kind,
    			namespace,
    			name,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 28.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/admission/plugin/cel/filter_test.go

    	return admission.NewAttributesRecord(object, oldObject, gvk, namespace, name, gvr, "", admission.Create, &metav1.CreateOptions{}, false, nil)
    }
    
    func endpointStatusUpdateAttributes() admission.Attributes {
    	attrs := endpointCreateAttributes()
    	return admission.NewAttributesRecord(
    		attrs.GetObject(), attrs.GetObject(), attrs.GetKind(), attrs.GetNamespace(), attrs.GetName(),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 40.4K bytes
    - Viewed (0)
  9. plugin/pkg/admission/gc/gc_admission_test.go

    			if tc.oldObj != nil {
    				operation = apiserveradmission.Update
    				options = &metav1.UpdateOptions{}
    			}
    			user := &user.DefaultInfo{Name: tc.username}
    			attributes := apiserveradmission.NewAttributesRecord(tc.newObj, tc.oldObj, schema.GroupVersionKind{}, metav1.NamespaceDefault, "foo", tc.resource, tc.subresource, operation, options, false, user)
    
    			err = gcAdmit.Validate(context.TODO(), attributes, nil)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 21:28:42 UTC 2024
    - 24.5K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/generic/policy_test_context.go

    	if err != nil {
    		return err
    	}
    
    	nonNilMeta, err := meta.Accessor(nonNilObject)
    	if err != nil {
    		return err
    	}
    
    	return p.Plugin.Dispatch(
    		p,
    		admission.NewAttributesRecord(
    			new,
    			old,
    			gvk,
    			nonNilMeta.GetName(),
    			nonNilMeta.GetNamespace(),
    			gvr,
    			"",
    			operation,
    			nil,
    			false,
    			nil,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 19K bytes
    - Viewed (0)
Back to top