-
Notifications
You must be signed in to change notification settings - Fork 18
Commit c430330
committed
bpfman-operator: watch DaemonSet, remove DS finaliser, rework teardown
Previously, a finaliser was added to the DaemonSet, which blocked its
deletion unless explicitly removed. However, the operator only watched
the ConfigMap—not the DaemonSet—so forced DaemonSet deletions went
unnoticed, and the DaemonSet was never recreated.
This change reworks that behaviour to match standard Kubernetes
operator design:
- Adds a `Watches(&DaemonSet{}, EnqueueRequestsFromMapFunc(...))` that
maps all DaemonSet events back to the ConfigMap. This enables
self-healing: if the DaemonSet is deleted, the operator observes the
event and recreates it.
- Removes the DaemonSet finaliser entirely. It's unnecessary because
the parent ConfigMap holds the only finaliser. This is in line with
Kubernetes guidance: only finalise the resource responsible for
managing others.
- Replaces monolithic teardown with ordered, step-wise deletion of
managed resources (DaemonSet, CSIDriver, SCC), requeuing between
each step. This ensures deletion is safe, idempotent, and resilient
to propagation delays or transient failures.
- Removes the ConfigMap finaliser only after all dependent resources
have been confirmed deleted. This prevents race conditions and
ensures a clean operator shutdown.
These changes bring the controller in line with normal operator
architecture: use a single "source of truth" object (ConfigMap in this
case), watch and reconcile dependents explicitly, and rely on
finalisers only where needed.
Signed-off-by: Andrew McDermott <[email protected]>1 parent 4bd625b commit c430330Copy full SHA for c430330
File tree
2 files changed
+385
-204
lines changedFilter options
- controllers/bpfman-operator
2 files changed
+385
-204
lines changed
0 commit comments