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 · 1 comment
Open
3 tasks done

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

hau21um opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants