argoproj / argo-cd

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

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

Open sthomson-wyn opened 5 months ago

sthomson-wyn commented 5 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 5 months ago

/assign

andrii-korotkov-verkada commented 2 days ago

ArgoCD versions 2.10 and below have reached EOL. Can you upgrade and tell us if the issue is still present, please?

sthomson-wyn commented 2 days ago

Yep it's still present https://github.com/argoproj/argo-cd/blob/b39f3b15fbf1abf59177b58b6e87a44e32600bbe/controller/appcontroller.go#L1070