should fix the: Error response from daemon: This node is not a swarm manager. issue

This commit is contained in:
andreagalle 2023-04-26 07:04:53 +00:00
parent 412f514bb4
commit 0dc2d2b1e6

View file

@ -596,6 +596,7 @@ check_5_14() {
maxretry_unset_containers=""
for c in $containers; do
container_name=$(docker inspect "$c" --format '{{.Name}}')
if [ "$(docker info --format '{{.Swarm.LocalNodeState}}')" = "active" ]; then
for s in $(docker service ls --format '{{.Name}}'); do
if echo $container_name | grep -q "$s"; then
task_id=$(docker inspect "$c" --format '{{.Name}}' | awk -F '.' '{print $NF}')
@ -607,6 +608,7 @@ check_5_14() {
fi
fi
done
fi
cpolicy=$(docker inspect --format MaximumRetryCount='{{ .HostConfig.RestartPolicy.MaximumRetryCount }}' "$c")
if [ "$cpolicy" != "MaximumRetryCount=5" ] && [ "$spolicy" != "MaxAttempts=5" ]; then