-
Notifications
You must be signed in to change notification settings - Fork 13
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
ROX-15806: Remove pause reconcile annotation before Central deletion #905
ROX-15806: Remove pause reconcile annotation before Central deletion #905
Conversation
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.
Looks good, only one small improvement
|
||
if central.Annotations != nil { | ||
// avoid being stuck in a deprovisioning state due to the pause reconcile annotation | ||
if _, exists := central.Annotations[pauseReconcileAnnotation]; exists { |
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.
Maybe check that it's set to true and not just exist? This will help avoid unnecessary updates in the reconciliation loop before Central is actually deleted.
Unit test? |
I'm trying to write a test, but it's proving hard to write a meaningful test with the fake client.
Any ideas? I could go for a e2e test for example. I can also extract the code that changes the annotation into a separate function, and only unit test that function. |
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kovayur, vladbologa The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
If a Central has the pause-reconcile annotation set, and its deletion is requested, it currently remains stuck in a deprovisioning state. The Central itself is not deleted by the Operator, however fleetshard-sync deletes all its other resources, making it unusable.
This PR takes the approach of setting the pause-reconcile annotation to false (if it's present). This way the Central is deleted, and the UI is not in an inconsistent state.
An alternative would be to have also fleetshard-sync not reconcile a Central that has the annotation set.
Checklist (Definition of Done)
Test manual
ROX-12345: ...
Test manual
Tested locally.