From daf8750edb80fac9cfbba50079266db3ec7aaf48 Mon Sep 17 00:00:00 2001 From: Hank Freund Date: Wed, 24 Jul 2024 10:13:47 -0700 Subject: [PATCH] Fix panic when enabling expander debug logs. A logging statement was malformed causing a panic. Rewrote the logging statement and verified all tests pass. --- .../composition/internal/controller/expander_reconciler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experiments/compositions/composition/internal/controller/expander_reconciler.go b/experiments/compositions/composition/internal/controller/expander_reconciler.go index 6b91dd3d17..bb2e261fbd 100644 --- a/experiments/compositions/composition/internal/controller/expander_reconciler.go +++ b/experiments/compositions/composition/internal/controller/expander_reconciler.go @@ -346,8 +346,8 @@ func (r *ExpanderReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c if expanderDebugLogsEnabled { r.Recorder.Event(&inputcr, "Normal", fmt.Sprintf("Finished expander stage %d: %s", index, expander), expanderDebugLog(&inputcr)+fmt.Sprintf("---resource count: %d", applier.Count())) for i, resourceStatus := range newStatus.Stages[expander].LastApplied { - logger.Info("Resource %d, Resource name: %s, resource namespace: %s, resource gvk: %s %s %s, resource status: %s", - i, resourceStatus.Name, resourceStatus.Namespace, resourceStatus.Group, resourceStatus.Version, resourceStatus.Kind, resourceStatus.Health) + logger.Info("Expander debug logs", "Resource", i, "Name", resourceStatus.Name, "Namespace", resourceStatus.Namespace, "Group", + resourceStatus.Group, "Version", resourceStatus.Version, "Kind", resourceStatus.Kind, "Status", resourceStatus.Health) } } }