-
Notifications
You must be signed in to change notification settings - Fork 38
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 support for finalizers in application resource #159
feat: add support for finalizers in application resource #159
Conversation
dea40c8
to
18d180f
Compare
The idea of finalizers in K8s is to have an operator (like, a Crossplane provider) suspend the deletion of a resource to perform some cleanup steps. Usually you would have a single finalizer added and removed by each operator. @amotolani can you describe the use case why you would like to have a bunch of finalizers statically added here? It would forever block the deletion of the resource unless the user explicitly removes it before deleting the MR. |
@MisterMX A specific use case for this is controlling the deletion behaviour for ArgoCD apps. Without deletion finalizers the default behaviour is to delete the ArgoCD App without cleaning up the resources created by the ArgoCD app in a cluster, adding finalizers will enable cascade deletion for ArgoCD Apps. |
Does this work with the delete flow of this controller? If a users adds arbitrary finalizers to an MR application and then deletes it with |
@MisterMX Sorry it took me a while to get back here. ArgoCD will only cleanup valid finalizers. So if a user adds an arbitrary finalizer that is not valid it would block deletion of the ArgoCD Application and by extension the MR. IMO this is an ArgoCD concern and not really one for the provider. Taking aside AFAIK Finalizers are the only way to control this deletion behaviour declaratively, and it comes with this issue you highlighted |
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.
Thanks for the clarification. I have one other remark.
3e133ad
to
930b982
Compare
@MisterMX I made the suggested improvements |
4628b91
to
412961f
Compare
Signed-off-by: David Adelowo <[email protected]>
412961f
to
3f80d07
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.
LGTM. Thank you very much @amotolani!
Description of your changes
Fixes #
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested