mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +00:00
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)
|
return PolicyRule{}, fmt.Errorf("non-resource rule may not have apiGroups, resources, or resourceNames: %#v", r.PolicyRule)
|
||||||
}
|
}
|
||||||
case len(r.PolicyRule.Resources) > 0:
|
case len(r.PolicyRule.Resources) > 0:
|
||||||
if len(r.PolicyRule.NonResourceURLs) != 0 {
|
// resource rule may not have nonResourceURLs
|
||||||
return PolicyRule{}, fmt.Errorf("resource rule may not have nonResourceURLs: %#v", r.PolicyRule)
|
|
||||||
}
|
|
||||||
if len(r.PolicyRule.APIGroups) == 0 {
|
if len(r.PolicyRule.APIGroups) == 0 {
|
||||||
// this a common bug
|
// this a common bug
|
||||||
return PolicyRule{}, fmt.Errorf("resource rule must have apiGroups: %#v", r.PolicyRule)
|
return PolicyRule{}, fmt.Errorf("resource rule must have apiGroups: %#v", r.PolicyRule)
|
||||||
|
Loading…
Reference in New Issue
Block a user