mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
Fix OwnerReferencesPermissionEnforcement complaints when autodeleting PVCs
When StatefulSetAutoDeletePVC feature gate is enabled, StatefulSet controller updates ownerReferences on managed PVCs. To be able to pass OwnerReferencesPermissionEnforcement admission, it must have permissions to delete PVCs.
This commit is contained in:
parent
8f2371bcce
commit
ebc5b208ae
@ -384,7 +384,7 @@ func buildControllerRoles() ([]rbacv1.ClusterRole, []rbacv1.ClusterRoleBinding)
|
||||
}
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetAutoDeletePVC) {
|
||||
role.Rules = append(role.Rules, rbacv1helpers.NewRule("update").Groups(legacyGroup).Resources("persistentvolumeclaims").RuleOrDie())
|
||||
role.Rules = append(role.Rules, rbacv1helpers.NewRule("update", "delete").Groups(legacyGroup).Resources("persistentvolumeclaims").RuleOrDie())
|
||||
}
|
||||
|
||||
return role
|
||||
|
Loading…
Reference in New Issue
Block a user