run_sdk_container: use exact match for existing containers

run_sdk_container uses the sourcetree version to decide whether to
re-use existing containers or create new ones. However, containers were
not matched by exact name - instead, plain --filter name="..." was used,
leading to prefix matching. This change updates name="..." to use
regular expressions for exact matching.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
This commit is contained in:
Thilo Fromm 2022-01-05 09:10:29 +01:00
parent 536acc3dab
commit 2c8d09192d

View File

@ -77,7 +77,7 @@ if [ -z "$name" ] ; then
name="flatcar-sdk-${arch}-${docker_sdk_vernum}_os-${docker_os_vernum}"
fi
stat="$(docker ps --all --no-trunc --filter name="$name" --format '{{.Status}}'\
stat="$(docker ps --all --no-trunc --filter name="^/$name\$" --format '{{.Status}}'\
| cut -f1 -d' ')"
# pass SDK related environment variables and gcloud auth