-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add controller permissions to set blockOwnerDeletion #49133
Conversation
is there a related issue, or is this only with an admission plugin enabled? |
Only when its enabled. We need to enable it for e2e tests, but I think I'd do that separately. |
blocking deletion of the owning object seems like it should require finalization permissions on the owning object more than deletion permissions |
this would be a great use case for a consistent |
sgtm. @deads2k It looks like we haven't enabled the |
/lgtm |
Adding do-not-merge because the release note process has not been followed. |
Adding do-not-merge/release-note-label-needed because the release note process has not been followed. |
I really don't want to give delete permissions to controllers that don't need them, simply so they can pass a synthetic permissions check for this admission plugin. Long-term, I'd like to see a consistent strawman release note:
|
6077fc8
to
0b8b217
Compare
@liggitt updated to use update on |
// ownerReference can only refer to an object in the same namespace, so attributes.GetNamespace() equals to the owner's namespace | ||
Namespace: attributes.GetNamespace(), | ||
APIGroup: groupVersion.Group, | ||
APIVersion: groupVersion.Version, | ||
Resource: mapping.Resource, | ||
Resource: mapping.Resource + "/finalizers", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subresource field in this struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subresource field in this struct
fixed.
0b8b217
to
37d8526
Compare
/retest |
@@ -39,20 +39,29 @@ func (fakeAuthorizer) Authorize(a authorizer.Attributes) (bool, string, error) { | |||
if a.GetVerb() == "delete" { | |||
return false, "", nil | |||
} | |||
if a.GetVerb() == "update" && a.GetSubresource() == "/finalizers" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/finalizers" or "finalizers"?
37d8526
to
2572ea5
Compare
/retest |
this lgtm. @caesarxuchao, any final comments? relatedly, can you open a doc PR for this admission plugin? kubernetes/website#3588 noted we were missing documentation for it |
The design and code lgtm. I'm concerned whether it's backward incompatible. I guess it breaks existing users that set blockOwnerDeletion, since no one has permission to update the finalizer subresources. |
Only if you enable this admission plugin, and if you did that, all your existing controllers were broken already. Given that there was no documentation around this plug-in, and of the default policy did not work with it, I doubt there are any existing users. I think a release noted change is sufficient |
Makes sense. LGTM. |
/retest |
/approve |
Tagging per comments |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, deads2k, derekwaynecarr Associated issue: 51970 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
/retest |
Automatic merge from submit-queue (batch tested with PRs 49133, 51557, 51749, 50842, 52018) |
@deads2k: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
fixes #51970
blockOwnerDeletion
requires delete permissions on the owner object. This adds that permission for our controllers.@kubernetes/sig-auth-misc