Skip to content

Commit

Permalink
Fix panic when enabling expander debug logs.
Browse files Browse the repository at this point in the history
A logging statement was malformed causing a panic. Rewrote the logging
statement and verified all tests pass.
  • Loading branch information
hankfreund committed Jul 24, 2024
1 parent 47f552f commit daf8750
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit daf8750

Please sign in to comment.