-
Notifications
You must be signed in to change notification settings - Fork 1
feat: only delete cluster if all other finalizers on cluster resource are gone #85
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
Conversation
81c9640 to
1b6c3a0
Compare
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.
Can you please put the search algorithm in a separate function and add some unit tests for it please?
I moved the logic into a small helper function. Regarding the tests: The helper method is not exported, which means that unit tests for it would only be possible if the testing package is the same as the code package. I usually use Instead of testing the helper function, we could also add tests using the @maximiliantech How should we continue here? Adding a small test for the helper function only or merging this now and create unit tests for the whole reconciliation logic in a separate task? |
|
Thanks for adding this as a helper function. I would vote for writing a unit test as part of this PR to simply increase the confidence of the implementation. I would say we don't use the The test for the whole reconciliation logic can be done in a separate issue/PR. |
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.
Reviewed and approved before ✅ I simply refactored the unit test to use the table driven design + Go's testing package instead of Ginkgo/Gomega.
This PR needs another review from someone else to get merged.
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.
👍
What this PR does / why we need it:
With this PR, the cluster controller waits with deleting the cluster until all other finalizers have been removed from the
Clusterresource. This is helpful, because other controllers that put finalizers on theClusterresource likely need access to the cluster to clean up whatever they deployed onto it, which is not possible anymore if the cluster is removed as soon as theClusterresource gets a deletion timestamp.Which issue(s) this PR fixes:
Part of openmcp-project/backlog#313
Fixes #81
Special notes for your reviewer:
Release note: