Skip to content

Commit

Permalink
buildkite: don't remove the boostrap container
Browse files Browse the repository at this point in the history
In bash, "for" reads word by word by default.
The current code expects that it reads line by line.

PiperOrigin-RevId: 513577172
  • Loading branch information
avagin authored and gvisor-bot committed Mar 2, 2023
1 parent 56d6af8 commit 8b92c91
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .buildkite/hooks/post-command
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b92c91

Please sign in to comment.