From 8b92c912b2d64f5eabc8587015f155dfc77e31f8 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 2 Mar 2023 10:32:29 -0800 Subject: [PATCH] buildkite: don't remove the boostrap container In bash, "for" reads word by word by default. The current code expects that it reads line by line. PiperOrigin-RevId: 513577172 --- .buildkite/hooks/post-command | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/hooks/post-command b/.buildkite/hooks/post-command index 3d1a93fd8..88bbbb49f 100644 --- a/.buildkite/hooks/post-command +++ b/.buildkite/hooks/post-command @@ -71,12 +71,12 @@ if test "${BUILDKITE_COMMAND_EXIT_STATUS}" -ne "0"; then fi # Kill any running containers (clear state), except for "bootstrap". -for id_and_name in $(docker ps --format='{{.ID}} {{.Names}}'); do - if [[ "$(echo "$id_and_name" | cut -d' ' -f2-)" == 'bootstrap' ]]; then +for id_and_name in $(docker ps --format='{{.ID}}/{{.Names}}'); do + if [[ "$(echo "$id_and_name" | cut -d'/' -f2-)" == 'bootstrap' ]]; then continue fi timeout --kill-after=10s --preserve-status 8s \ - docker container kill "$(echo "$id_and_name" | cut -d' ' -f1)" + docker container kill "$(echo "$id_and_name" | cut -d'/' -f1)" done set -euo pipefail