From e680ab2465be8f8381fedb0b7dac2c6eef6334a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 25 Sep 2023 15:29:45 +0000 Subject: [PATCH] update restart_policy w/o swarm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/5_container_runtime.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/5_container_runtime.sh b/tests/5_container_runtime.sh index bccdf61..7e8ed07 100644 --- a/tests/5_container_runtime.sh +++ b/tests/5_container_runtime.sh @@ -609,7 +609,9 @@ check_5_14() { fi done fi - restart_policy=$(docker inspect --format '{{ .HostConfig.RestartPolicy.MaximumRetryCount }}' "$c") + if docker inspect --format '{{ .HostConfig.RestartPolicy.MaximumRetryCount }}' "$c" &>/dev/null; then + restart_policy=$(docker inspect --format '{{ .HostConfig.RestartPolicy.MaximumRetryCount }}' "$c") + fi if [ "$restart_policy" -gt "5" ]; then # If it's the first container, fail the test