argoproj / argo-cd

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

AppProjects don't check all namespaces before finalizing deletion #18361

Open sthomson-wyn opened 3 months ago

sthomson-wyn commented 3 months ago

Checklist:

Describe the bug

If the resources finalizer is used on an AppProject, the application controller doesn't check all namespaces for existing Applications before finalizing deletion

To Reproduce

Expected behavior

The AppProject waits for all Applications to delete before removing the finalizer

Screenshots

Version

argocd: v2.9.3+6eba5be.dirty
  BuildDate: 2023-12-02T00:36:55Z
  GitCommit: 6eba5be864b7e031871ed7698f5233336dfe75c7
  GitTreeState: dirty
  GoVersion: go1.21.4
  Compiler: gc
  Platform: linux/amd64
argocd-server: v2.10.2+fcf5d8c

The problem code appears to be here: https://github.com/argoproj/argo-cd/blob/ee9b38fe5ce15ce72ca57cdf16b0addbe2b0a27a/controller/appcontroller.go#L1015 only the default namespace is checked for Applications

yyzxw commented 3 months ago

/assign