mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-31 06:22:32 +01:00
should fix the: Error response from daemon: This node is not a swarm manager. issue
This commit is contained in:
parent
412f514bb4
commit
0dc2d2b1e6
1 changed files with 12 additions and 10 deletions
|
@ -596,6 +596,7 @@ check_5_14() {
|
||||||
maxretry_unset_containers=""
|
maxretry_unset_containers=""
|
||||||
for c in $containers; do
|
for c in $containers; do
|
||||||
container_name=$(docker inspect "$c" --format '{{.Name}}')
|
container_name=$(docker inspect "$c" --format '{{.Name}}')
|
||||||
|
if [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" = "active" ]; then
|
||||||
for s in $(docker service ls --format '{{.Name}}'); do
|
for s in $(docker service ls --format '{{.Name}}'); do
|
||||||
if echo $container_name | grep -q "$s"; then
|
if echo $container_name | grep -q "$s"; then
|
||||||
task_id=$(docker inspect "$c" --format '{{.Name}}' | awk -F '.' '{print $NF}')
|
task_id=$(docker inspect "$c" --format '{{.Name}}' | awk -F '.' '{print $NF}')
|
||||||
|
@ -607,6 +608,7 @@ check_5_14() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
cpolicy=$(docker inspect --format MaximumRetryCount='{{ .HostConfig.RestartPolicy.MaximumRetryCount }}' "$c")
|
cpolicy=$(docker inspect --format MaximumRetryCount='{{ .HostConfig.RestartPolicy.MaximumRetryCount }}' "$c")
|
||||||
|
|
||||||
if [ "$cpolicy" != "MaximumRetryCount=5" ] && [ "$spolicy" != "MaxAttempts=5" ]; then
|
if [ "$cpolicy" != "MaximumRetryCount=5" ] && [ "$spolicy" != "MaxAttempts=5" ]; then
|
||||||
|
|
Loading…
Reference in a new issue