diff --git a/changelog/v1.19.0-beta3/dump-all-containers-logs-on-test-fail.yaml b/changelog/v1.19.0-beta3/dump-all-containers-logs-on-test-fail.yaml new file mode 100644 index 00000000000..f84e55ce5cb --- /dev/null +++ b/changelog/v1.19.0-beta3/dump-all-containers-logs-on-test-fail.yaml @@ -0,0 +1,6 @@ +changelog: + - type: NON_USER_FACING + description: >- + Added pod/container name prefix to log lines and make sure all containers are logged on test failure + skipCI-kube-tests:true + skipCI-docs-build:true diff --git a/pkg/utils/statedumputils/state_dump.go b/pkg/utils/statedumputils/state_dump.go index 19654c1b240..dd8b9a01739 100644 --- a/pkg/utils/statedumputils/state_dump.go +++ b/pkg/utils/statedumputils/state_dump.go @@ -298,7 +298,7 @@ func recordCRs(ctx context.Context, namespaceDir string, namespace string) error // kubeLogs runs $(kubectl -n $namespace logs $pod --all-containers) and returns the string result func kubeLogs(namespace string, pod string) (string, string, error) { - args := []string{"-n", namespace, "logs", pod, "--all-containers"} + args := []string{"-n", namespace, "logs", pod, "--all-containers=true", "--prefix=true"} return kubeExecute(args) }