From 78fb6ed2e1096bf1fcf529ac0e70ec31c508665f Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:04:52 -0500 Subject: [PATCH] client-go/cache: Remove reflector context cancellation logging The error returned from Until() is solely from context cancellation which is expected behavior when the reflector is stopped. Logging this as an error (or even at V(4)) creates unnecessary noise. Kubernetes-commit: cc483208aa306b8c4078d4118cf78a10e58481ec --- tools/cache/reflector.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 2b8f8804d..a0e3a701c 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -425,14 +425,12 @@ func (r *Reflector) RunWithContext(ctx context.Context) { logger.V(3).Info("Starting reflector", "type", r.typeDescription, "resyncPeriod", r.resyncPeriod, "reflector", r.name) // Until runs the loop immediately (immediate=true) and resets the backoff timer after each // successful iteration (sliding=true). See backoff constants at top of file for generalized QPS targets (~0.22 QPS). - if err := r.delayHandler.Until(ctx, true, true, func(ctx context.Context) (bool, error) { + _ = r.delayHandler.Until(ctx, true, true, func(ctx context.Context) (bool, error) { if err := r.ListAndWatchWithContext(ctx); err != nil { r.watchErrorHandler(ctx, r, err) } return false, nil - }); err != nil { - logger.Error(err, "Reflector stopped with error", "type", r.typeDescription, "reflector", r.name) - } + }) logger.V(3).Info("Stopping reflector", "type", r.typeDescription, "resyncPeriod", r.resyncPeriod, "reflector", r.name) }