remove dead code in rbac helper
This commit is contained in:
parent
a57c33bd28
commit
ece3188507
@ -215,9 +215,8 @@ func (r *PolicyRuleBuilder) Rule() (PolicyRule, error) {
|
||||
return PolicyRule{}, fmt.Errorf("non-resource rule may not have apiGroups, resources, or resourceNames: %#v", r.PolicyRule)
|
||||
}
|
||||
case len(r.PolicyRule.Resources) > 0:
|
||||
if len(r.PolicyRule.NonResourceURLs) != 0 {
|
||||
return PolicyRule{}, fmt.Errorf("resource rule may not have nonResourceURLs: %#v", r.PolicyRule)
|
||||
}
|
||||
// resource rule may not have nonResourceURLs
|
||||
|
||||
if len(r.PolicyRule.APIGroups) == 0 {
|
||||
// this a common bug
|
||||
return PolicyRule{}, fmt.Errorf("resource rule must have apiGroups: %#v", r.PolicyRule)
|
||||
|
Loading…
Reference in New Issue
Block a user