-
Story
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
Product / Portfolio Work
-
False
-
-
False
-
3
-
None
-
None
-
Multi-Arch Sprint 258
2. We should set a finalizer in:
- ClusterPodPlacementConfig
- PodPlacementController deployment
DELETE
Let's consider a user (or the Console UI when uninstalling the operator) deletes the ClusterPodPlacementConfig: its DeletionTimestamp is set to the time the deletion request is received and all the objects, except the PodPlacementController are deleted (webhook, mutatingwebhook and services).
No more pods will be patched.
The Operator can find all the pods with a scheduling gate set by us by looking at all the pods labeled "multiarch.openshift.io/pod-placement-scheduling-gate: gated."
If any pod is found, the operator re-queues the deletion request with exponential backoff.
Once no pods are found, the operator can remove the finalizer in both the ClusterPodPlacementConfig object and the Pod placement controller deployment.
UPDATE
Udpates to the ClusterPodPlacementConfig can trigger the reconciliation of the controller and webhook. We don't need to execute the cleanup in this case because, eventually, the pod placement controller is restored and will process any pods not yet ungated.
We can remove the finalizers at any update unconditionally.