Merge pull request #2029 from weaveworks/router-and-proxy-always-restart
Router and proxy run with --restart=always
This commit is contained in:
commit
2a10182cf6
2 files changed
+36
No files matched your search
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#! /bin/bash
|
||||
|
||||
. ./config.sh
|
||||
|
||||
start_suite "Test docker restart policy"
|
||||
|
||||
pidof() {
|
||||
docker_on $1 inspect -f '{{.State.Pid}}' $2
|
||||
}
|
||||
|
||||
check_restart() {
|
||||
OLD_PID=$(pidof $1 $2)
|
||||
|
||||
run_on $1 sudo kill $OLD_PID
|
||||
|
||||
for i in $(seq 1 30); do
|
||||
NEW_PID=$(pidof $1 $2)
|
||||
|
||||
if [ $NEW_PID != 0 -a $NEW_PID != $OLD_PID ] ; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
weave_on $HOST1 launch
|
||||
|
||||
assert_raises "check_restart $HOST1 weave"
|
||||
assert_raises "check_restart $HOST1 weaveproxy"
|
||||
|
||||
end_suite
|
||||
@@ -1631,6 +1631,7 @@ launch_router() {
|
||||
# when launching the weave container.
|
||||
start_if_necessary router $CONTAINER_NAME $IMAGE \
|
||||
$(docker_run_options) \
|
||||
--restart=always \
|
||||
-e WEAVE_PASSWORD \
|
||||
-e CHECKPOINT_DISABLE \
|
||||
$WEAVE_DOCKER_ARGS $IMAGE $COVERAGE_ARGS \
|
||||
@@ -1687,6 +1688,7 @@ launch_proxy() {
|
||||
fi
|
||||
start_if_necessary proxy $PROXY_CONTAINER_NAME $EXEC_IMAGE \
|
||||
$(docker_run_options) \
|
||||
--restart=always \
|
||||
--pid=host \
|
||||
$PROXY_VOLUMES \
|
||||
--volumes-from $VOLUMES_CONTAINER_NAME \
|
||||
|
||||
Reference in new issue
Block a user