You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0ed05f2
Browse filesBrowse the repository at this point in the historyBrowse files
Kubernetes Submit Queue
authored
Merge pull request #49133 from deads2k/gc-02-permissions
Automatic merge from submit-queue (batch tested with PRs 49133, 51557, 51749, 50842, 52018)
add controller permissions to set blockOwnerDeletion
fixes#51970
`blockOwnerDeletion` requires delete permissions on the owner object. This adds that permission for our controllers.
@kubernetes/sig-auth-misc
```release-note
The OwnerReferencesPermissionEnforcement admission plugin now requires `update` permission on the `finalizers` subresource of the referenced owner in order to set `blockOwnerDeletion` on an owner reference.
```
returnadmission.NewForbidden(attributes, fmt.Errorf("cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't delete: %v, %v", reason, err))
125
+
returnadmission.NewForbidden(attributes, fmt.Errorf("cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: %v, %v", reason, err))
126
126
}
127
127
}
128
128
}
@@ -178,12 +178,13 @@ func (a *gcPermissionsEnforcement) ownerRefToDeleteAttributeRecords(ref metav1.O
178
178
for_, mapping:=rangemappings {
179
179
ret=append(ret, authorizer.AttributesRecord{
180
180
User: attributes.GetUserInfo(),
181
-
Verb: "delete",
181
+
Verb: "update",
182
182
// ownerReference can only refer to an object in the same namespace, so attributes.GetNamespace() equals to the owner's namespace
0 commit comments