From c8894d3b261f6f64edee48f8ce4992b464736eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Sun, 1 Jul 2018 20:53:20 +0200 Subject: [PATCH] deprecated --disable-legacy-registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- tests/2_docker_daemon_configuration.sh | 32 ++++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/tests/2_docker_daemon_configuration.sh b/tests/2_docker_daemon_configuration.sh index 0d615b4..625835e 100644 --- a/tests/2_docker_daemon_configuration.sh +++ b/tests/2_docker_daemon_configuration.sh @@ -284,20 +284,28 @@ check_2_12() { # 2.13 check_2_13() { - check_2_13="2.13 - Ensure operations on legacy registry (v1) are Disabled" + docker_version=$(docker version | grep -i -A2 '^server' | grep ' Version:' \ + | awk '{print $NF; exit}' | tr -d '[:alpha:]-,.') totalChecks=$((totalChecks + 1)) - if get_docker_configuration_file_args 'disable-legacy-registry' | grep 'true' >/dev/null 2>&1; then - pass "$check_2_13" - logjson "2.13" "PASS" - currentScore=$((currentScore + 1)) - elif get_docker_effective_command_line_args '--disable-legacy-registry' | grep "disable-legacy-registry" >/dev/null 2>&1; then - pass "$check_2_13" - logjson "2.13" "PASS" - currentScore=$((currentScore + 1)) + if [ "$docker_version" -lt 1712 ]; then + check_2_13="2.13 - Ensure operations on legacy registry (v1) are Disabled" + if get_docker_configuration_file_args 'disable-legacy-registry' | grep 'true' >/dev/null 2>&1; then + pass "$check_2_13" + logjson "2.13" "PASS" + currentScore=$((currentScore + 1)) + elif get_docker_effective_command_line_args '--disable-legacy-registry' | grep "disable-legacy-registry" >/dev/null 2>&1; then + pass "$check_2_13" + logjson "2.13" "PASS" + currentScore=$((currentScore + 1)) + else + warn "$check_2_13" + logjson "2.13" "WARN" + currentScore=$((currentScore - 1)) + fi else - warn "$check_2_13" - logjson "2.13" "WARN" - currentScore=$((currentScore - 1)) + check_2_13="2.13 - Ensure operations on legacy registry (v1) are Disabled (Deprecated)" + info "$check_2_13" + logjson "2.13" "info" fi }