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

PostDelete hook not usable when deleting files used by generators #18070

Open
3 tasks done
hau21um opened this issue May 3, 2024 · 6 comments
Open
3 tasks done

PostDelete hook not usable when deleting files used by generators #18070

hau21um opened this issue May 3, 2024 · 6 comments
Labels
bug Something isn't working component:application-sets Bulk application management related component:helm component:hooks version:2.11 Latest confirmed affected version is 2.11

Comments

@hau21um
Copy link

hau21um commented May 3, 2024

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

Using git generator in application set, which trigger application creation based on folder content with application configuration (helm in this case).

  generators:
  - git:
      files:
      - path: 'application-*/app-values.yaml'
      repoURL: https://github.com/hau21um/test-post-delete-app-set.git
      revision: HEAD

If this folder or some of its files needed to render the application manifest is deleted, application deletion is triggered properly, but the hook is not executed.

To Reproduce

  • fork https://github.com/hau21um/test-post-delete-app-set
  • modify all repoURL in test-post-delete-app-set.yaml to point to your fork
  • apply the modified test-post-delete-app-set.yaml
  • wait till all application-test-* are created and running
  • delete in your forked repo the application-test-3 folder, or rename it to deleted-application-test-3 or remove/rename the app-values.yaml file
  • wait till deletion is triggered and observe that no post-delete job is triggered, rather application ends with error message in app conditions "failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = helm template . --name-template application-test-3 --namespace application-test-3 --kube-version 1.26 --values <path to cached source>/application-test-3/app-values.yaml <api versions removed> --include-crds failed exit status 1: Error: open /application-test-3/app-values.yaml: no such file or directory"

To delete the application once all resources are removed from k8s by ArgoCD, you can remove finalizers section from Application metadata section, but this will not solve the main issue - that the post-delete is not run.

Expected behavior

The post-delete job should run and application get deleted.

Screenshots

image image

Version

v2.11.0-rc3

Logs

failed to generate manifest for source 1 of 1: rpc error: code = Unknown desc = helm template . --name-template application-test-3 --namespace application-test-3 --kube-version 1.26 --values <path to cached source>/application-test-3/app-values.yaml <api versions removed> --include-crds failed exit status 1: Error: open /application-test-3/app-values.yaml: no such file or directory
@hau21um hau21um added the bug Something isn't working label May 3, 2024
@hau21um hau21um changed the title PostDelete hook not usable when deleting generator files PostDelete hook not usable when deleting files used by generators May 3, 2024
@joebowbeer
Copy link
Contributor

joebowbeer commented May 7, 2024

Related #16595 (adding context)

@cvaliente
Copy link

That explains a lot. Also hit by this bug.

@crenshaw-dev crenshaw-dev added component:application-sets Bulk application management related and removed component:application-set labels Sep 26, 2024
@andrii-korotkov-verkada andrii-korotkov-verkada added the version:2.11 Latest confirmed affected version is 2.11 label Nov 11, 2024
@baldey-nz
Copy link

baldey-nz commented Dec 3, 2024

also hitting this bug, on v2.12.7+4d70c51

@GlenOsborneSpark
Copy link

also hitting this bug.. please fix

@mpluhar
Copy link

mpluhar commented Dec 5, 2024

Same here, also hitting that bug.

@andycee
Copy link

andycee commented Dec 8, 2024

Same here, but using the app of apps pattern. PostDelete hooks are not being executed after app deletion. Reproduced if I'll wait 10-15 min after app created

v2.13.1+af54ef8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:application-sets Bulk application management related component:helm component:hooks version:2.11 Latest confirmed affected version is 2.11
Projects
None yet
Development

No branches or pull requests

10 participants