Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 55 for NewAttributesRecord (0.23 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/errors_test.go

    )
    
    // makes sure that we never get:
    // Internal error occurred: [some error, object does not implement the Object interfaces]
    func TestNewForbidden(t *testing.T) {
    	attributes := NewAttributesRecord(
    		&fakeObj{},
    		nil,
    		schema.GroupVersionKind{Group: "foo", Version: "bar", Kind: "Baz"},
    		"",
    		"",
    		schema.GroupVersionResource{Group: "foo", Version: "bar", Resource: "baz"},
    		"",
    		Create,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 14 17:49:43 UTC 2019
    - 1.7K bytes
    - Viewed (0)
  2. plugin/pkg/admission/admit/admission_test.go

    )
    
    func TestAdmissionNonNilAttribute(t *testing.T) {
    	handler := admissiontesting.WithReinvocationTesting(t, NewAlwaysAdmit().(*alwaysAdmit))
    	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.8K bytes
    - Viewed (0)
  3. 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)
  4. plugin/pkg/admission/podnodeselector/admission_test.go

    		handler.clusterNodeSelectors[namespace.Name] = test.whitelist
    		pod.Spec = api.PodSpec{NodeSelector: test.podNodeSelector}
    
    		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)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 8K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. plugin/pkg/admission/network/denyserviceexternalips/admission_test.go

    			if tc.oldSvc == nil {
    				op = admission.Create
    				opt = &metav1.CreateOptions{}
    			} else {
    				op = admission.Update
    				opt = &metav1.UpdateOptions{}
    			}
    
    			attrs := admission.NewAttributesRecord(
    				tc.newSvc, // new object
    				tc.oldSvc, // old object
    				core.Kind("Service").WithVersion("version"),
    				tc.newSvc.Namespace,
    				tc.newSvc.Name,
    				corev1.Resource("services").WithVersion("version"),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 14 05:36:44 UTC 2021
    - 3K bytes
    - Viewed (0)
  8. plugin/pkg/admission/storage/storageobjectinuseprotection/admission_test.go

    			pvWithFinalizer.Namespace,
    		},
    	}
    
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			ctrl := newPlugin()
    
    			obj := test.object.DeepCopyObject()
    			attrs := admission.NewAttributesRecord(
    				obj,                  // new object
    				obj.DeepCopyObject(), // old object, copy to be sure it's not modified
    				schema.GroupVersionKind{},
    				test.namespace,
    				"foo",
    				test.resource,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 14 00:05:53 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  9. plugin/pkg/admission/nodetaint/admission_test.go

    			options:        &metav1.CreateOptions{},
    			expectedTaints: []api.Taint{notReadyTaint},
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			attributes := admission.NewAttributesRecord(&tt.node, &tt.oldNode, nodeKind, myNodeObj.Namespace, myNodeObj.Name, resource, "", tt.operation, tt.options, false, mynode)
    			c := NewPlugin()
    			err := c.Admit(context.TODO(), attributes, nil)
    			if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 06 04:56:21 UTC 2019
    - 3.1K bytes
    - Viewed (0)
  10. 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)
Back to top