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

Allow users to disable deletion for specific objects when application is cascade-deleted #7124

Closed
mvazquezc opened this issue Aug 31, 2021 · 4 comments · Fixed by #12448
Closed
Assignees
Labels
enhancement New feature or request

Comments

@mvazquezc
Copy link

Summary

Add a new sync option that allows users to disable deletion for specific objects when the application is cascade-deleted.

This will be useful when running patches through Argo CD on objects such as nodes, oauth configs, etc. without this option if the app gets deleted with cascade deletion enabled those objects are deleted.

Motivation

I need to add a label to a node, I add that label in a yaml file on my repo. Argo CD reads the file and patches the node object adding this new label. Then I delete my Argo CD application with cascade deletion and my node object is deleted. I'd like to have a sync option to disable the deletion for specific objects that I don't want to be deleted on cascade.

Proposal

Add a new sync-option "Delete=false" that gets checked before deleting the object, if it's found then the object deletion is skipped.

@jannfis
Copy link
Member

jannfis commented Sep 3, 2021

We do have sync option Prune=false already. Have you tested using that?

@mvazquezc
Copy link
Author

We do have sync option Prune=false already. Have you tested using that?

Yes. Prune false works as expected when you delete content from Git and you don’t want it to be deleted from the cluster. In this case we need that when deleting the app, I tested deleting the app with prune=false and the patched content was deleted as well. Am I missing anything?

@ceesgeene
Copy link

This would be a useful option to allow PersistentVolumeClaims (and the PersistentVolume they are bound to) to survive the temporary deletion of their ArgoCD application that is subsequently be recreated.

@chary1112004
Copy link

chary1112004 commented Feb 9, 2023

@jannfis I have tested then object is still deleted (here in this case pvc is still deleted) even add annotation as below:

metadata:
  annotations:
    argocd.argoproj.io/sync-options: Prune=false

image

Any solution to resolve this issue would be very much appreciated.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants