From 4def9ac818b7dc7305b417a26bf244adebbfc6a5 Mon Sep 17 00:00:00 2001 From: Lee Bernick Date: Thu, 8 Jun 2023 10:04:11 -0400 Subject: [PATCH] Add pod name to build_logs test output When integration tests fail, logs are printed from failed pods. This commit adds the pod name to the output, in addition to the container name, to make debugging easier in scenarios where multiple pods have the same container name. (This is common with unnamed steps.) --- test/build_logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/build_logs.go b/test/build_logs.go index 018f8a190bc..9ba46a746a5 100644 --- a/test/build_logs.go +++ b/test/build_logs.go @@ -45,7 +45,7 @@ func getContainersLogsFromPod(ctx context.Context, c kubernetes.Interface, pod, sb := strings.Builder{} for _, container := range p.Spec.Containers { - sb.WriteString(fmt.Sprintf("\n>>> Container %s:\n", container.Name)) + sb.WriteString(fmt.Sprintf("\n>>> Pod %s Container %s:\n", p.Name, container.Name)) logs, err := getContainerLogsFromPod(ctx, c, pod, container.Name, namespace) if err != nil { return "", err