From 02ce4752f65c8d49d974fabd3519197532e70839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Tue, 12 Nov 2024 16:52:57 +0100 Subject: [PATCH] chore: fix log (#857) --- controller/dataplane/owned_finalizer_controller.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controller/dataplane/owned_finalizer_controller.go b/controller/dataplane/owned_finalizer_controller.go index 04d8579c2..c150743fc 100644 --- a/controller/dataplane/owned_finalizer_controller.go +++ b/controller/dataplane/owned_finalizer_controller.go @@ -142,7 +142,9 @@ func (r DataPlaneOwnedResourceFinalizerReconciler[T, PT]) Reconcile(ctx context. // If the object does not have the finalizer, we don't need to do anything. hasDataPlaneOwnedFinalizer := lo.Contains(obj.GetFinalizers(), consts.DataPlaneOwnedWaitForOwnerFinalizer) if !hasDataPlaneOwnedFinalizer { - log.Debug(logger, fmt.Sprintf("object has no %q finalizer", consts.DataPlaneOwnedWaitForOwnerFinalizer), obj) + log.Debug(logger, "object has no finalizer", + "finalizer", consts.DataPlaneOwnedWaitForOwnerFinalizer, + ) return ctrl.Result{}, nil } @@ -191,7 +193,9 @@ func (r DataPlaneOwnedResourceFinalizerReconciler[T, PT]) Reconcile(ctx context. return ctrl.Result{}, fmt.Errorf("failed to remove finalizer from %s %s: %w", obj.GetObjectKind().GroupVersionKind().Kind, obj.GetName(), err) } - log.Debug(logger, fmt.Sprintf("removed %q finalizer", consts.DataPlaneOwnedWaitForOwnerFinalizer), obj) + log.Debug(logger, "removed finalizer", + "finalizer", consts.DataPlaneOwnedWaitForOwnerFinalizer, + ) return ctrl.Result{}, nil }