Wait for proxy to become available after docker is restarted
This commit is contained in:
1 parent
77c7963bde
commit
6b9e8816d1
1 file changed
+13
-1
@@ -11,6 +11,18 @@ check_attached() {
|
|||||||
assert_dns_record $HOST1 c1 $NAME $C2
|
assert_dns_record $HOST1 c1 $NAME $C2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wait_for_proxy() {
|
||||||
|
for i in $(seq 1 120); do
|
||||||
|
echo "Waiting for proxy to start"
|
||||||
|
if proxy docker_on $1 info > /dev/null 2>&1 ; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo "Timed out waiting for proxy to start" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
start_suite "Proxy restart reattaches networking to containers"
|
start_suite "Proxy restart reattaches networking to containers"
|
||||||
|
|
||||||
WEAVE_DOCKER_ARGS=--restart=always WEAVEPROXY_DOCKER_ARGS=--restart=always weave_on $HOST1 launch
|
WEAVE_DOCKER_ARGS=--restart=always WEAVEPROXY_DOCKER_ARGS=--restart=always weave_on $HOST1 launch
|
||||||
@@ -32,7 +44,7 @@ check_attached
|
|||||||
|
|
||||||
# Restart docker itself, using different commands for systemd- and upstart-managed.
|
# Restart docker itself, using different commands for systemd- and upstart-managed.
|
||||||
run_on $HOST1 sh -c "command -v systemctl >/dev/null && sudo systemctl restart docker || sudo service docker restart"
|
run_on $HOST1 sh -c "command -v systemctl >/dev/null && sudo systemctl restart docker || sudo service docker restart"
|
||||||
sleep 10
|
wait_for_proxy $HOST1
|
||||||
check_attached
|
check_attached
|
||||||
|
|
||||||
# Restarting proxy shouldn't kill unattachable containers
|
# Restarting proxy shouldn't kill unattachable containers
|
||||||
|
|||||||
Reference in new issue
Block a user