-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: Add final-deletion-state Flag to Set Custom State When DeletionTimestamp is Set #148
feat: Add final-deletion-state Flag to Set Custom State When DeletionTimestamp is Set #148
Conversation
Note: The logic is implemented in a way that whatever, state is set, the CR will not leave that state once deletion timestamp is set. The other way to implement would be setting state to custom state when deletion timstamp is set and then letting the normal controller logic set the state as it is done until now. However, if we take that approach, then some states will be flickering like in parent issue. For eg: if --final-deletion-state is set to Error and deletion timestamp is set, the CR will go in state Error but then the controller would handle the error state and find no errors so it set it back to Ready until the next loop sets the CR back to Error and then the cycle repeats. Therefore, it is important that we stay in the state set in the flag. However, this means that once the flag is set and the controller is running, there is no way to change the flag, that means if a CR is set to Warning state after deletion in a test, The finalizer has to be removed manually in the test teardown, otherwise the CR will persist. |
1b897ff
to
f923e1d
Compare
I repurposed the the old SampleCR tests because I would have had to create a whole new suite for test one field as messing with the reconciler in the suite would mean other tests in the suite would become flaky. |
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.
Default should not be set for a FinalDeletionState. If it is not set, then the template-operator should behave normal, without being stuck in some state. Please revisit the implementation and make needed changes to implement it in described way
Description
Changes proposed in this pull request:
final-deletion-state
to Template-Operator Manager - can be used to set a custom state when deletion timestamp is set (default Deleting)Related issue(s)
Closes #147