Skip to content

Commit 8a4f367

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#39544 from foxish/fix-rbac-disruption
Automatic merge from submit-queue (batch tested with PRs 39544, 39552, 39553) Allow disruption controller to read statefulsets **What this PR does / why we need it**: Disruption controller was unable to list/watch statefulsets when RBAC is enabled because it wasn't granted permission. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes#39541 cc @mwielgus
2 parents 0bbb49d + a8a6502 commit 8a4f367

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

plugin/pkg/auth/authorizer/rbac/bootstrappolicy/controller_policy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func init() {
108108
rbac.NewRule("get", "list", "watch").Groups(extensionsGroup).Resources("replicasets").RuleOrDie(),
109109
rbac.NewRule("get", "list", "watch").Groups(legacyGroup).Resources("replicationcontrollers").RuleOrDie(),
110110
rbac.NewRule("get", "list", "watch").Groups(policyGroup).Resources("poddisruptionbudgets").RuleOrDie(),
111+
rbac.NewRule("get", "list", "watch").Groups(appsGroup).Resources("statefulsets").RuleOrDie(),
111112
rbac.NewRule("update").Groups(policyGroup).Resources("poddisruptionbudgets/status").RuleOrDie(),
112113
eventsRule(),
113114
},

plugin/pkg/auth/authorizer/rbac/bootstrappolicy/testdata/controller-roles.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,15 @@ items:
263263
- get
264264
- list
265265
- watch
266+
- apiGroups:
267+
- apps
268+
attributeRestrictions: null
269+
resources:
270+
- statefulsets
271+
verbs:
272+
- get
273+
- list
274+
- watch
266275
- apiGroups:
267276
- policy
268277
attributeRestrictions: null

0 commit comments

Comments
 (0)