Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for MatchObjectSelector (0.2 sec)

  1. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher.go

    		return false
    	}
    	return selector.Matches(labels.Set(accessor.GetLabels()))
    
    }
    
    // MatchObjectSelector decideds whether the request matches the ObjectSelector
    // of the webhook. Only when they match, the webhook is called.
    func (m *Matcher) MatchObjectSelector(p ObjectSelectorProvider, attr admission.Attributes) (bool, *apierrors.StatusError) {
    	selector, err := p.GetParsedObjectSelector()
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 26 00:41:14 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/predicates/object/matcher_test.go

    				Rule:       v1.Rule{APIGroups: []string{"*"}, APIVersions: []string{"*"}, Resources: []string{"*"}, Scope: &allScopes},
    			}}}
    
    		t.Run(testcase.name, func(t *testing.T) {
    			match, err := matcher.MatchObjectSelector(webhook.NewValidatingWebhookAccessor("mock-hook", "mock-cfg", hook), testcase.attrs)
    			if err != nil {
    				t.Error(err)
    			}
    			if testcase.expectCall && !match {
    				t.Errorf("expected the webhook to be called")
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 26 00:41:14 UTC 2022
    - 4.7K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/admission/plugin/policy/matching/matching.go

    	if !matches && matchNsErr == nil {
    		return false, schema.GroupVersionResource{}, schema.GroupVersionKind{}, nil
    	}
    
    	matches, matchObjErr := m.objectMatcher.MatchObjectSelector(criteria, attr)
    	// Should not return an error here for policy which do not apply to the request, even if err is an unexpected scenario.
    	if !matches && matchObjErr == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 06 00:00:21 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go

    		return nil, nil
    	}
    
    	// Should not return an error here for webhooks which do not apply to the request, even if err is an unexpected scenario.
    	matches, matchObjErr := a.objectMatcher.MatchObjectSelector(h, attr)
    	if !matches && matchObjErr == nil {
    		return nil, nil
    	}
    
    	var invocation *WebhookInvocation
    	for _, r := range h.GetRules() {
    		m := rules.Matcher{Rule: r, Attr: attr}
    		if m.Matches() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 9.3K bytes
    - Viewed (0)
Back to top