Skip to content
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

Fix set blockOwnerDeletion failures for OwnerReferencesPermissionEnforcement enabled clusters #797

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

kaovilai
Copy link
Contributor

@kaovilai kaovilai commented Mar 31, 2023

Fixes #434

If OwnerReferencesPermissionEnforcement admission controller is enabled, such as on OpenShift, ConfigConnector operator would fail with error forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on

This PR ensures that operator's manager role has sufficient permission to update finalizer on a configconnector resource which will then allow us to set blockOwnerDeletion on resources created via Reconcile of a ConfigConnector.

@google-cla
Copy link

google-cla bot commented Mar 31, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kaovilai kaovilai changed the title Corrects RBAC OwnerReferencesPermissionEnforcement enabled clusters Corrects RBAC for OwnerReferencesPermissionEnforcement enabled clusters Mar 31, 2023
@kaovilai
Copy link
Contributor Author

Working on obtaining CLA with @eparis

@kaovilai
Copy link
Contributor Author

kaovilai commented Apr 1, 2023

Looked for ways to test SA clusterrole.. seems like not easy with envtest.

@kaovilai kaovilai changed the title Corrects RBAC for OwnerReferencesPermissionEnforcement enabled clusters Fix setting blockOwnerDeletion failures for OwnerReferencesPermissionEnforcement enabled clusters Apr 1, 2023
@kaovilai kaovilai changed the title Fix setting blockOwnerDeletion failures for OwnerReferencesPermissionEnforcement enabled clusters Fix set blockOwnerDeletion failures for OwnerReferencesPermissionEnforcement enabled clusters Apr 1, 2023
@kaovilai
Copy link
Contributor Author

kaovilai commented Apr 3, 2023

@diviner524 could you please review?

If [OwnerReferencesPermissionEnforcement](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#ownerreferencespermissionenforcement) is turned on, such as on OpenShift, ConfigConnector operator would fail with error `forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on`

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>

Limit finalizers role to update verb

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@diviner524 diviner524 merged commit 26b40e2 into GoogleCloudPlatform:master Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator needs finalizer permission in RBAC to work in OpenShift
2 participants