Skip to content

Commit

Permalink
chore: fix string formatting for several debug statements (#2769)
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Perry <yrrepnoj@gmail.com>
Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
  • Loading branch information
YrrepNoj and AustinAbro321 authored Jul 26, 2024
1 parent 754c615 commit 4886043
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ 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
}

// 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
}
Expand Down
8 changes: 4 additions & 4 deletions src/pkg/cluster/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand All @@ -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) {
Expand All @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 4886043

Please sign in to comment.