Skip to content
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: Added annotation to skip resource deletion when app is deleted #5945 #5977

Closed

Conversation

JoaoBraveCoding
Copy link

@JoaoBraveCoding JoaoBraveCoding commented Apr 6, 2021

Closes #5945

Checklist:

  • [a] Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@JoaoBraveCoding JoaoBraveCoding force-pushed the added-delete-option branch 2 times, most recently from 409150c to f941a75 Compare April 6, 2021 20:39
@JoaoBraveCoding JoaoBraveCoding changed the title Added annotation to skip resource deletion when application is deleted #5945 fix: Added annotation to skip resource deletion when app is deleted #5945 Apr 6, 2021
@JoaoBraveCoding JoaoBraveCoding force-pushed the added-delete-option branch 2 times, most recently from a7bf739 to bf66bf0 Compare April 6, 2021 20:47
@JoaoBraveCoding JoaoBraveCoding changed the title fix: Added annotation to skip resource deletion when app is deleted #5945 feat: Added annotation to skip resource deletion when app is deleted #5945 Apr 6, 2021
@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #5977 (b955951) into master (b003f70) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5977   +/-   ##
=======================================
  Coverage   40.95%   40.95%           
=======================================
  Files         147      147           
  Lines       19656    19656           
=======================================
  Hits         8051     8051           
  Misses      10499    10499           
  Partials     1106     1106           
Impacted Files Coverage Δ
controller/appcontroller.go 53.52% <100.00%> (ø)
util/settings/settings.go 41.46% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b003f70...b955951. Read the comment docs.

@JoaoBraveCoding JoaoBraveCoding force-pushed the added-delete-option branch 3 times, most recently from ade472c to e2aa7b2 Compare April 7, 2021 09:29
@JoaoBraveCoding
Copy link
Author

/assign @alexmt

@alexmt alexmt self-requested a review April 20, 2021 22:06
@jessesuen
Copy link
Member

We discussed this enhancement in today's contributor's meeting and folks were on board with the feature. Some points which were raised:

  1. I think we should use key-value options instead of a one-word option. e.g.:

argocd.argoproj.io/delete-options: Policy=Never

This will leave the door open for introducing different policies in the future. An example of where this could be useful, is that Argo CD currently decides not to delete CRDs as a safe default. But for users who do want CRDs to be deleted as part of application delete, we could introduce a:

argocd.argoproj.io/delete-options: Policy=Always

that users could attach to a CRD.

  1. How does this interact (if at all) with the existing argocd.argoproj.io/sync-options: Prune=false annotation?

The idea which was discussed was that if someone is specifying argocd.argoproj.io/delete-options: Policy=Never, then it's highly likely they do not want it pruned as well. So I proposed that argocd.argoproj.io/delete-options: Policy=Never would automatically imply argocd.argoproj.io/sync-options: Prune=false. The rationale is that it's hard to come up with a use case where user would want to skip deletion but allow it to get pruned as part of sync. So rather than have users specify both annotations, they could simply specify the delete-option: Policy=Never

  1. Finally, this is not necessarily relevant to this PR, but we envision future improvements to delete-options to include support other kubectl delete options: e.g.
  • Force=true
  • Cascade=Orphan

@crenshaw-dev
Copy link
Member

Closing for now. Please feel free to reopen or open a new PR based on this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annotation on child resources so ArgoCD doesn't delete them when parrent Application gets deleted
3 participants