From 2b67ac98eff547ac4f82991b7e438cdb615a8675 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" <6454655+adoroszlai@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:22:10 +0800 Subject: [PATCH] HDDS-11186. First container log missing from bundle (#6952) (cherry picked from commit e01a57d8988d89a5c8a985989ee5ac240decac5d) --- hadoop-ozone/dist/src/main/compose/testlib.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-ozone/dist/src/main/compose/testlib.sh b/hadoop-ozone/dist/src/main/compose/testlib.sh index c13ca1bb80e..505cb1ae77c 100755 --- a/hadoop-ozone/dist/src/main/compose/testlib.sh +++ b/hadoop-ozone/dist/src/main/compose/testlib.sh @@ -304,9 +304,10 @@ get_output_name() { save_container_logs() { local output_name=$(get_output_name) - local c - for c in $(docker-compose ps "$@" | cut -f1 -d' ' | tail -n +3); do - docker logs "${c}" >> "$RESULT_DIR/docker-${output_name}${c}.log" 2>&1 + local id + for i in $(docker-compose ps -a -q "$@"); do + local c=$(docker ps -a --filter "id=${i}" --format "{{ .Names }}") + docker logs "${i}" >> "$RESULT_DIR/docker-${output_name}${c}.log" 2>&1 done }