From fde33672ba01876b2685752f90d7fbf57232993a Mon Sep 17 00:00:00 2001 From: Scot Wells Date: Thu, 27 Aug 2026 17:05:30 -0500 Subject: [PATCH] fix: stop the sweep's logger shadowing the log import Lint fails on main: the local logger in sweepLegacyPlacements is named log, which shadows the controller-runtime log package this file imports. Co-Authored-By: Claude Opus 5 (1M context) --- internal/controller/networkfabricidentity_controller.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/controller/networkfabricidentity_controller.go b/internal/controller/networkfabricidentity_controller.go index 49b0e48..e1a5505 100644 --- a/internal/controller/networkfabricidentity_controller.go +++ b/internal/controller/networkfabricidentity_controller.go @@ -431,12 +431,12 @@ func (r *NetworkFabricIdentityReconciler) unplace(ctx context.Context, namespace // a correctness problem worth logging loudly where a controller that will not // start reconciles nothing at all. func (r *NetworkFabricIdentityReconciler) sweepLegacyPlacements(ctx context.Context) error { - log := ctrl.LoggerFrom(ctx) + logger := ctrl.LoggerFrom(ctx) var policies unstructured.UnstructuredList policies.SetGroupVersionKind(clusterPropagationPolicyGVK.GroupVersion().WithKind("ClusterPropagationPolicyList")) if err := r.Hub.List(ctx, &policies, client.MatchingLabels{FabricIdentityPolicyLabel: "true"}); err != nil { - log.Error(err, "could not read the fabric identity placement policies to sweep") + logger.Error(err, "could not read the fabric identity placement policies to sweep") return nil } @@ -446,11 +446,11 @@ func (r *NetworkFabricIdentityReconciler) sweepLegacyPlacements(ctx context.Cont continue } if err := r.Hub.Delete(ctx, policy); err != nil && !apierrors.IsNotFound(err) { - log.Error(err, "could not remove a legacy per-location placement policy, it will keep competing for identities", + logger.Error(err, "could not remove a legacy per-location placement policy, it will keep competing for identities", "policy", policy.GetName()) continue } - log.Info("removed a legacy per-location placement policy", "policy", policy.GetName()) + logger.Info("removed a legacy per-location placement policy", "policy", policy.GetName()) } return nil }