From 43bce37333c2b1e0845dc6db67b212e99c114ea0 Mon Sep 17 00:00:00 2001 From: Ondra Kupka Date: Tue, 27 Jan 2026 12:23:49 +0100 Subject: [PATCH] guard controller: Handle conflict gracefully Currently the controller degrades on any error, including an apply conflict. This can happen during upgrades and should not be the case. The cause is probably the fact that we delete and create the guard pod in the very same sync call. But instead of handling this specifically, the apply call now simply ignores conflict errors and sync is automatically invoked again as the changes propagate. --- pkg/operator/staticpod/controller/guard/guard_controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/operator/staticpod/controller/guard/guard_controller.go b/pkg/operator/staticpod/controller/guard/guard_controller.go index 5b34749e20..6d803317cd 100644 --- a/pkg/operator/staticpod/controller/guard/guard_controller.go +++ b/pkg/operator/staticpod/controller/guard/guard_controller.go @@ -380,7 +380,9 @@ func (c *GuardController) sync(ctx context.Context, syncCtx factory.SyncContext) _, _, err = resourceapply.ApplyPod(ctx, c.podGetter, syncCtx.Recorder(), pod) if err != nil { klog.Errorf("Unable to apply pod %v changes: %v", pod.Name, err) - errs = append(errs, fmt.Errorf("Unable to apply pod %v changes: %v", pod.Name, err)) + if !apierrors.IsConflict(err) { + errs = append(errs, fmt.Errorf("Unable to apply pod %v changes: %v", pod.Name, err)) + } } } }