From a519b97b85495506a14efa633de512e534ed3318 Mon Sep 17 00:00:00 2001 From: Cameron McAvoy Date: Wed, 13 Sep 2023 12:31:22 -0500 Subject: [PATCH] Fix excessive trace logging in the machine health check controller --- .../machinehealthcheck/machinehealthcheck_targets.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controllers/machinehealthcheck/machinehealthcheck_targets.go b/internal/controllers/machinehealthcheck/machinehealthcheck_targets.go index 5d174fb63155..9b1ff909aa96 100644 --- a/internal/controllers/machinehealthcheck/machinehealthcheck_targets.go +++ b/internal/controllers/machinehealthcheck/machinehealthcheck_targets.go @@ -203,7 +203,7 @@ func (r *Reconciler) getTargetsFromMHC(ctx context.Context, logger logr.Logger, targets := []healthCheckTarget{} for k := range machines { - logger.WithValues("Machine", klog.KObj(&machines[k])) + logger := logger.WithValues("Machine", klog.KObj(&machines[k])) skip, reason := shouldSkipRemediation(&machines[k]) if skip { logger.Info("skipping remediation", "reason", reason) @@ -286,7 +286,7 @@ func (r *Reconciler) healthCheckTargets(targets []healthCheckTarget, logger logr var healthy []healthCheckTarget for _, t := range targets { - logger = logger.WithValues("Target", t.string()) + logger := logger.WithValues("Target", t.string()) logger.V(3).Info("Health checking target") needsRemediation, nextCheck := t.needsRemediation(logger, timeoutForMachineToHaveNode)