fix: Make Cluster Mesh work with OwnerReferencesPermissionEnforcement#43912
Conversation
|
Tested locally the additional permisssions with: |
|
Hi 👋, TIL about this and thanks for tackling this! Here is the similar fixes on the EndpointSlice controller back in 2020 😅: kubernetes/kubernetes#89741. Apparently we would only need the update verbs if the linked PR is still correct today. There's also a nice explanation in the comment there which I would suggest to (at least partially) steal: |
Yes, you are correct. I just checked the |
Some clusters have the admission plugin OwnerReferencesPermissionEnforcement activated. This plugin protects access to metadata.ownerReferences[x].blockOwnerDeletion, only users with the update permission to the finalizers subresource of the referenced owner can change it. This adds such permissions to the cilium-operator clusterRole, as the operator sets EnpointSlices owner references. Signed-off-by: Frederic Giloux <frederic.giloux@isovalent.com>
7902ee3 to
88bca72
Compare
There was a problem hiding this comment.
Thanks @fgiloux for taking care of this!
Would you be up for updating the definition of our test clusters (Cluster Mesh workflows use .github/kind-config.yaml.tmpl) to enable the extra admission plugins as you did in your testing? That would allow to immediately spot possible problems like this in the future.
|
/test |
The admission plugin OwnerReferencesPermissionEnforcement adds constraints when owner references are set. This plugin is, for instance, activated by default on OpenShift. This will help with catching permission issues in CI. Signed-off-by: Frederic Giloux <frederic.giloux@isovalent.com>
I have added a commit for it. I wish the way to set up kind (and possibly other things) would be shared between local dev and CI. It would make local validation easier. |
|
/test |
|
Multiple workflows failed due to #43901. Rerunning. |
|
This was reverted, let's not do backports for now. |
Ah it was only a partial revert. So let's bring it back, but require a manual backport. |
Makes sense, I'll take care of the backports once #43949 lands. |
Some clusters have the admission plugin OwnerReferencesPermissionEnforcement activated. This plugin protects access to metadata.ownerReferences[x].blockOwnerDeletion, only users with the update permission to the finalizers subresource of the referenced owner can change it.
This adds such permissions to the cilium-operator clusterRole, as the operator sets EnpointSlices owner references.