Skip to content

Commit d22aca0

Browse files
authored
Merge pull request kubernetes-sigs#9419 from cnmcavoy/cnmcavoy/machine-health-check-logging
🐛 Fix excessive trace logging in the machine health check controller
2 parents eb256f0 + 49c9525 commit d22aca0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/controllers/machinehealthcheck/machinehealthcheck_targets.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func (r *Reconciler) getTargetsFromMHC(ctx context.Context, logger logr.Logger,
203203

204204
targets := []healthCheckTarget{}
205205
for k := range machines {
206-
logger.WithValues("Machine", klog.KObj(&machines[k]))
206+
logger := logger.WithValues("Machine", klog.KObj(&machines[k]))
207207
skip, reason := shouldSkipRemediation(&machines[k])
208208
if skip {
209209
logger.Info("skipping remediation", "reason", reason)
@@ -286,7 +286,7 @@ func (r *Reconciler) healthCheckTargets(targets []healthCheckTarget, logger logr
286286
var healthy []healthCheckTarget
287287

288288
for _, t := range targets {
289-
logger = logger.WithValues("Target", t.string())
289+
logger := logger.WithValues("Target", t.string())
290290
logger.V(3).Info("Health checking target")
291291
needsRemediation, nextCheck := t.needsRemediation(logger, timeoutForMachineToHaveNode)
292292

0 commit comments

Comments
 (0)