mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #47897 from xilabao/dead-code-in-rbac-helper
Automatic merge from submit-queue (batch tested with PRs 49238, 49595, 43494, 47897, 48905) remove dead code in rbac helper **What this PR does / why we need it**: validated in `case len(r.PolicyRule.NonResourceURLs) > 0:` . **Which issue this PR fixes**: #49540 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
7988797233
@ -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