Skip to content

Commit 0c642b6

Browse files
authored
Merge pull request kubernetes#93508 from deads2k/endpointmirror
add permissions required by endpoints controller for blockOwnerDeletion
2 parents d3edcb7 + 7c25f39 commit 0c642b6

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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ func buildControllerRoles() ([]rbacv1.ClusterRole, []rbacv1.ClusterRoleBinding)
168168
// The controller needs to be able to set a service's finalizers to be able to create an EndpointSlice
169169
// resource that is owned by the service and sets blockOwnerDeletion=true in its ownerRef.
170170
rbacv1helpers.NewRule("update").Groups(legacyGroup).Resources("services/finalizers").RuleOrDie(),
171+
// The controller needs to be able to set a service's finalizers to be able to create an EndpointSlice
172+
// resource that is owned by the endpoint and sets blockOwnerDeletion=true in its ownerRef.
173+
// see https://github.com/openshift/kubernetes/blob/8691466059314c3f7d6dcffcbb76d14596ca716c/pkg/controller/endpointslicemirroring/utils.go#L87-L88
174+
rbacv1helpers.NewRule("update").Groups(legacyGroup).Resources("endpoints/finalizers").RuleOrDie(),
171175
rbacv1helpers.NewRule("get", "list", "create", "update", "delete").Groups(discoveryGroup).Resources("endpointslices").RuleOrDie(),
172176
eventsRule(),
173177
},

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ items:
544544
- services/finalizers
545545
verbs:
546546
- update
547+
- apiGroups:
548+
- ""
549+
resources:
550+
- endpoints/finalizers
551+
verbs:
552+
- update
547553
- apiGroups:
548554
- discovery.k8s.io
549555
resources:

0 commit comments

Comments
 (0)