Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix string formatting for several debug statements #2769

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading