Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
Thomas Sjögren 2017-01-23 13:13:48 +01:00
parent fc30bdaf55
commit 95e6ac8253

View file

@ -147,9 +147,13 @@ check_2_14="2.14 - Enable live restore"
get_docker_effective_command_line_args '--live-restore' 2>/dev/null | grep "live-restore" >/dev/null 2>&1
if [ $? -eq 0 ]; then
pass "$check_2_14"
else
if docker info 2>/dev/null | grep -e "Swarm:\s*active\s*" >/dev/null 2>&1; then
pass "$check_2_14 (Incompatible with swarm mode)"
else
warn "$check_2_14"
fi
fi
# 2.15
check_2_15="2.15 - Do not enable swarm mode, if not needed"
@ -162,12 +166,16 @@ fi
# 2.16
check_2_16="2.16 - Control the number of manager nodes in a swarm"
docker node ls 2>/dev/null | grep "Leader" >/dev/null 2>&1
if [ $? -eq 1 ]; then
if docker info 2>/dev/null | grep -e "Swarm:\s*active\s*" >/dev/null 2>&1; then
managernodes=$(docker node ls | grep "Leader" | wc -l)
if [ $managernodes -le 1 ]; then
pass "$check_2_16"
else
warn "$check_2_16"
fi
else
pass "$check_2_16 (Swarm mode not enabled)"
fi
# 2.17
check_2_17="2.17 - Bind swarm services to a specific host interface"