l sync-containers3: don't start if consul fails
This commit is contained in:
parent
3918ad6cf8
commit
4591d70e1c
@ -135,7 +135,8 @@ in {
|
|||||||
;;
|
;;
|
||||||
200)
|
200)
|
||||||
# echo 'got 200 from kv, will check payload'
|
# echo 'got 200 from kv, will check payload'
|
||||||
export payload=$(consul kv get containers/${ctr.name})
|
payload=$(consul kv get containers/${ctr.name}) || continue
|
||||||
|
export payload
|
||||||
if [ "$(jq -rn 'env.payload | fromjson.host')" = '${config.networking.hostName}' ]; then
|
if [ "$(jq -rn 'env.payload | fromjson.host')" = '${config.networking.hostName}' ]; then
|
||||||
# echo 'we are the host, trying to reach container'
|
# echo 'we are the host, trying to reach container'
|
||||||
if $(retry -t 10 -d 10 -- /run/wrappers/bin/ping -q -c 1 ${ctr.name}.r > /dev/null); then
|
if $(retry -t 10 -d 10 -- /run/wrappers/bin/ping -q -c 1 ${ctr.name}.r > /dev/null); then
|
||||||
|
Loading…
Reference in New Issue
Block a user