Skip to content

Commit

Permalink
Add pod name to build_logs test output
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
lbernick authored and tekton-robot committed Jun 12, 2023
1 parent 98d9ac7 commit 4def9ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/build_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4def9ac

Please sign in to comment.