Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for resourceMatches (0.23 sec)

  1. pkg/apis/rbac/v1/evaluation_helpers.go

    	for _, ruleGroup := range rule.APIGroups {
    		if ruleGroup == rbacv1.APIGroupAll {
    			return true
    		}
    		if ruleGroup == requestedGroup {
    			return true
    		}
    	}
    
    	return false
    }
    
    func ResourceMatches(rule *rbacv1.PolicyRule, combinedRequestedResource, requestedSubresource string) bool {
    	for _, ruleResource := range rule.Resources {
    		// if everything is allowed, we match
    		if ruleResource == rbacv1.ResourceAll {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 18 15:37:57 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  2. pkg/apis/rbac/helpers_test.go

    			expected:                  false,
    		},
    	}
    
    	for _, tc := range tests {
    		t.Run(tc.name, func(t *testing.T) {
    			rule := &rbac.PolicyRule{
    				Resources: tc.ruleResources,
    			}
    			actual := rbac.ResourceMatches(rule, tc.combinedRequestedResource, tc.requestedSubresource)
    			if tc.expected != actual {
    				t.Errorf("expected %v, got %v", tc.expected, actual)
    			}
    
    		})
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 9.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go

    		obj, err = storage.injectedFunction(obj)
    	}
    	if err := updateValidation(ctx, &storage.item, obj); err != nil {
    		return nil, false, err
    	}
    	return obj, false, err
    }
    
    // Implement ResourceWatcher.
    func (storage *SimpleRESTStorage) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error) {
    	storage.lock.Lock()
    	defer storage.lock.Unlock()
    	storage.checkContext(ctx)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 20:15:22 UTC 2023
    - 158.7K bytes
    - Viewed (0)
Back to top