Hi everyone,
I noticed some behavior that I'd like to discuss. Say we have some object with a finalizer to prevent it from being deleted, e.g.
```
kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
finalizers:
-
acme.org/keep name: test
namespace: default
EOF
```
If I now foreground-delete this object repeatedly,
```
kubectl delete cm test --cascade=foreground
```
Kubernetes will happily keep adding the foregroundDeletion finalizer (and instantly remove it, but that's not relevant here).
My question is: is it intentional that repeated DELETEs will re-add the foreground finalizer? I would rather expect that it is only set once, when the object actually goes into the in-deletion state (deletionTimestamp being set).
Where this can actually matter is if you write a controller that owns some resources (creates them with owner references), but actually also "manually" deletes those objects when the owner is being deleted. This essentially can cause a feedback loop where the controller deletes the dependent, adding a finalizer, GC removes that finalizer, causing the owner to be reconciled, causing the controller to delete the dependent, and so on.
Arguably this would be incorrect usage and the controller should just leave the deletion to GC, however I'm just wondering if there's a particular reason that the finalizer will be re-added every time.
Best
Ingo