From 4886043a8883fe26591dc677f9050b7c13e77e35 Mon Sep 17 00:00:00 2001 From: Jonathan Perry Date: Fri, 26 Jul 2024 08:47:33 -0400 Subject: [PATCH] chore: fix string formatting for several debug statements (#2769) Signed-off-by: Jon Perry Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> --- src/pkg/cluster/cluster.go | 4 ++-- src/pkg/cluster/data.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pkg/cluster/cluster.go b/src/pkg/cluster/cluster.go index b4eb28051b..801fd50173 100644 --- a/src/pkg/cluster/cluster.go +++ b/src/pkg/cluster/cluster.go @@ -93,7 +93,7 @@ func waitForHealthyCluster(ctx context.Context, client kubernetes.Interface) err // Make sure there is at least one running Node nodeList, err := client.CoreV1().Nodes().List(ctx, metav1.ListOptions{}) if err != nil || len(nodeList.Items) < 1 { - message.Debug("No nodes reporting healthy yet: %v\n", err) + message.Debugf("No nodes reporting healthy yet: %v\n", err) timer.Reset(waitDuration) continue } @@ -101,7 +101,7 @@ func waitForHealthyCluster(ctx context.Context, client kubernetes.Interface) err // Get the cluster pod list pods, err := client.CoreV1().Pods(corev1.NamespaceAll).List(ctx, metav1.ListOptions{}) if err != nil { - message.Debug("Could not get the pod list: %w", err) + message.Debugf("Could not get the pod list: %v", err) timer.Reset(waitDuration) continue } diff --git a/src/pkg/cluster/data.go b/src/pkg/cluster/data.go index cd46dbb28b..8d9c2070cc 100644 --- a/src/pkg/cluster/data.go +++ b/src/pkg/cluster/data.go @@ -197,7 +197,7 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac return nil, err } - message.Debug("Found %d pods for target %#v", len(podList.Items), target) + message.Debugf("Found %d pods for target %#v", len(podList.Items), target) var readyPods = []corev1.Pod{} @@ -207,7 +207,7 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac }) for _, pod := range podList.Items { - message.Debug("Testing pod %q", pod.Name) + message.Debugf("Testing pod %q", pod.Name) // If an include function is provided, only keep pods that return true if include != nil && !include(pod) { @@ -216,7 +216,7 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac // Handle container targeting if target.Container != "" { - message.Debug("Testing pod %q for container %q", pod.Name, target.Container) + message.Debugf("Testing pod %q for container %q", pod.Name, target.Container) // Check the status of initContainers for a running match for _, initContainer := range pod.Status.InitContainerStatuses { @@ -238,7 +238,7 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac } } else { status := pod.Status.Phase - message.Debug("Testing pod %q phase, want (%q) got (%q)", pod.Name, corev1.PodRunning, status) + message.Debugf("Testing pod %q phase, want (%q) got (%q)", pod.Name, corev1.PodRunning, status) // Regular status checking without a container if status == corev1.PodRunning { readyPods = append(readyPods, pod)