argo-cd
argo-cd copied to clipboard
(Force) Delete doesn't work well if an object has a finalizer owned by a missing object
Checklist:
- [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [x] I've included steps to reproduce the bug.
- [x] I've pasted the output of
argocd version
.
Describe the bug
We're using https://github.com/evryfs/github-actions-runner-operator, and GitHub had an outage of sorts which resulted in a mess. We had a pod that we couldn't delete. We tried deleting it w/ ArgoCD, we tried asking argo to Force delete it, we tried deleting it w/ k9s, we deleted the Node using k9s, we asked k9s to force delete it, it still wouldn't die (it was obviously mostly gone at this point, but kubernetes insisted it still existed). We tried to delete the ArgoCD application containing the operator. Everything except the stuck pod went away. We even tried deleting the namespace.
To delete it, we had to edit the pod and remove the finalizer. Once we did that, the object quickly dissipated.
To Reproduce
- Install an operator that creates an object (with a finalizer)
- Get the object into an unhappy state
- Delete the operator
- Try to delete the object using ArgoCD (w/ Force)
Expected behavior
Either Force should check for finalizers and remove them, or the delete dialog should offer to remove them. Personally, since the object is being deleted, I see no reason that Force shouldn't just remove them. Odds are the user already tried being nice. But, failing that, it'd be really nice if ArgoCD offered an extra option to shoot the finalizer, or, if it recognized that the object wasn't dying, suggested editing the object to remove the finalizer....
Screenshots
Version
{
"Version": "v2.2.0+78e256e",
"BuildDate": "2021-12-03T22:39:09Z",
"GitCommit": "78e256eef3dc5fdb8553e58c024d234d8e354e20",
"GitTreeState": "clean",
"GoVersion": "go1.16.5",
"Compiler": "gc",
"Platform": "linux/amd64",
"KsonnetVersion": "v0.13.1",
"KustomizeVersion": "v4.2.0 2021-06-30T22:49:26Z",
"HelmVersion": "v3.7.1+g1d11fcb",
"KubectlVersion": "v0.22.2",
"JsonnetVersion": "v0.17.0"
}
Logs
👍
Either Force should check for finalizers and remove them, or the delete dialog should offer to remove them
I recently witnessed this particular bug. I would concur that force delete does seem like its functionality should remove the targeted resource under any circumstance.
I would be interested in understanding if an alternative solution, with a significantly lower development barrier, of logging a warning and presenting an attached dialogue to force delete that explains this limitation would be accepted by the broader community of maintainers.
If you have a lot of apps like me (> 1500) Here is short cmd to delete all shucked apps