Merge pull request #137838 from hoskeri/leasespam

Fix logspam in leaderelection controller.
This commit is contained in:
Kubernetes Prow Robot
2026-03-18 12:11:38 +05:30
committed by GitHub

View File

@@ -166,7 +166,9 @@ func (c *Controller) processNextElectionItem(ctx context.Context) bool {
}
intervalForRequeue, err := c.reconcileElectionStep(ctx, key)
utilruntime.HandleErrorWithContext(ctx, err, "Failed to reconcile election step")
if err != nil { // HandleErrorWithContext logs regardless of error value, filter out nil err.
utilruntime.HandleErrorWithContext(ctx, err, "Failed to reconcile election step", "key", key)
}
if intervalForRequeue != noRequeue {
defer c.queue.AddAfter(key, intervalForRequeue)
}