-
Couldn't load subscription status.
- Fork 250
feat: update RGD controller to set CRD ownership and optimize watches #749
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
base: main
Are you sure you want to change the base?
feat: update RGD controller to set CRD ownership and optimize watches #749
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jakobmoellerdev The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
639ddf3 to
5736203
Compare
Updated the ResourceGraphDefinition controller to set correct ownership references on CRDs and switched to metadata-only watches for improved performance and reduced memory consumption. Added integration tests to validate CRD ownership. Signed-off-by: Jakob Möller <[email protected]>
5736203 to
2165971
Compare
|
i'm not very sure we need ownerReferences on CRDs. This is conflicting with the fact that we have a --allow-crd-deletion flag https://github.com/kubernetes-sigs/kro/blob/main/helm/values.yaml#L97-L98. |
|
I think we have very static / classic controller ownership relations between RGD<->CRD. Thus I think also deletion behavior can be controlled by an ownerref and allow crd deletion can be deprecated in favor of ownerreferences. just my opinion of course, happy to hear other thoughts. |
|
Thanks for picking up my issue, @jakobmoellerdev! I'm obviously biased, but the owner relationship feels logical to me. Why would we want to keep CRDs around after an RGD is deleted? |
| return false | ||
| }, | ||
| DeleteFunc: func(e event.DeleteEvent) bool { | ||
| return false |
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.
I would say we do want to reconcile RGDs when the CRD they manage gets deleted so we re-create them
Updated the ResourceGraphDefinition controller to set correct ownership references on CRDs and switched to metadata-only watches for improved performance and reduced memory consumption. Added integration tests to validate CRD ownership.
This would resolve both cleanup of the CRD with background deletion mode and resolution of owner refs in general but has the side effect that RGDs must stay non-namespaced (I think this is static by now and we can move to ownerrefs safely)
resolves #745