-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Deleting ApplicationSet causes Application deletion even if applicationset-controller policy is 'create-only' #12172
Comments
Hi @mikutas However, I think I do agree that if the policy is set to create-only then the expectation would be that applications should not be affected by anything that is done by or to the appset controller I can bring this up with the maintainers and see what they think |
I think this issue is currently addressed in the open PR #11462. |
#11462 just makes the setting configurable on a per-ApplicationSet basis. It won't fix any bugs with the existing global configuration. |
Hi @mikutas I believe the proposed idea was that we could set a finalizer on the applicationset resource, after which the applicationset controller can check if the Does that make sense @jessesuen @crenshaw-dev? |
@jaideepr97 I think that does make sense! |
@crenshaw-dev Thanks, I can work on a PR for this |
Hi @jaideepr97, is there any update about this one? |
Having just run into this myself I think after observing the behavior and re-reading the docs that this was probably the intended behavior, but the documentation doesn't make it clear that the setting only prevents the AppSetController itself from deleting/modifying Apps (ie, you change the git source somehow).
|
👍 |
Looks like @jaideepr97 has not been able to work on this. If anyone else would like to pick up the work, I'd happily review. |
For anyone else also looking at a workaround until this is fixed, the trick is to delete the ApplicationSet with If this is on an ArgoCD app that creates/manages ApplicationSets inside, this can be done by setting
on the parent app that creates the ApplicationSets (see https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#resources-prune-deletion-propagation-policy). |
…#15903) * fix(applicationset): prevent app deletion according to appset policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * test: add unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: remove TODO Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
…j#12172) (argoproj#15903) * fix(applicationset): prevent app deletion according to appset policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * test: add unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: remove TODO Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> Signed-off-by: jmilic1 <70441727+jmilic1@users.noreply.github.com>
… allow app's deletion (#12172) (#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
…j#12172) (argoproj#15903) * fix(applicationset): prevent app deletion according to appset policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * test: add unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: remove TODO Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
… allow app's deletion (argoproj#12172) (argoproj#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
…j#12172) (argoproj#15903) * fix(applicationset): prevent app deletion according to appset policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * test: add unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: remove TODO Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
… allow app's deletion (argoproj#12172) (argoproj#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
… allow app's deletion (argoproj#12172) (argoproj#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
Hi All, I tested the mentioned fix, but I am still able to delete an ApplicationSet and as a consequence the child Applications are deleted too. Unfortunately in Application Set controller there is not logging when the deletion timestamp is set. How can investigate why this happens? |
I am trying to come up with a fix for a similar issue where |
If i add a finalizer on applicationset, the applicationset-controller gets chance to remove the ownerrefs when applicationset is deleted. Applications are preserved when later finalizer is removed to complete applicationset cleanup. |
…j#12172) (argoproj#15903) * fix(applicationset): prevent app deletion according to appset policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * test: add unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: remove TODO Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> Signed-off-by: Kevin Lyda <kevin@lyda.ie>
… allow app's deletion (argoproj#12172) (argoproj#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> Signed-off-by: Kevin Lyda <kevin@lyda.ie>
…j#12172) (argoproj#15903) * fix(applicationset): prevent app deletion according to appset policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * test: add unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: unit test Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * fix: remove TODO Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
… allow app's deletion (argoproj#12172) (argoproj#16506) * fix(appset): remove unnecessary condition Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> * docs: update explanation about policy Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com> --------- Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
Checklist:
argocd version
.Describe the bug
To Reproduce
git clone https://github.com/mikutas/app-of-apps-with-helm-experiment
make argocd
kubectl edit -n argocd argocd-applicationset-controller
--policy create-only
tospec.template.spec.containers[0].command
kustomize build appsets/overlays/development/ | k apply -f -
test
createdfoo-apps
createdkubectl delete -n argocd applicationset test
Expected behavior
Since I set 'create-only' policy to applicationset-controller, Application
foo-apps
are not deleted.Screenshots
Version
Logs
application-controller (not applicationset-controller) outputs following logs.
The text was updated successfully, but these errors were encountered: