Return only one result, if there are multiple matches

Among other things, this is the case, when running tests with multiple containers.
This commit is contained in:
Casper 2020-06-12 18:52:32 +02:00 committed by GitHub
parent 8c7597f546
commit 29406ff34d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ if [ -z "$CRI" ]; then
fi
fi
INFO=$($CRI ps --no-trunc --format "{{.Image}};{{.Names}}" --filter label=org.label-schema.name="docker-mailserver")
INFO=$($CRI ps --no-trunc --format "{{.Image}};{{.Names}}" --filter label=org.label-schema.name="docker-mailserver" | tail -1)
IMAGE_NAME=${INFO%;*}
CONTAINER_NAME=${INFO#*;}