argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.33k stars 4.93k forks source link

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

Open hau21um opened 2 weeks ago

hau21um commented 2 weeks ago

Checklist:

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

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
joebowbeer commented 1 week ago

Related #16595 (adding context)