Fix re-attaching of weave router in awsvpc mode

In order to re-attach the router and make it work in awsvpc mode,
the following has to be done:

- expose_ip on the router
- adjusting arp settings
- restoring host routes

To detect that we run in awsvpc mode, we inspect cmd parameters
of the weave router instead of GET'ing /ipinfo/tracker. This is so,
because the HTTP server started by the router might not be running
at the time of restoration.
This commit is contained in:
Martynas Pumputis committed 2016-06-29 11:15:49 +01:00
1 parent 7165414fc3
commit 58caf38f07
3 files changed
+17 -9

No files matched your search

+7
View File
@@ -1656,6 +1656,10 @@ launch_router() {
setup_router_iface_$BRIDGE_TYPE
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
populate_router
setup_awsvpc
}
setup_awsvpc() {
if [ -n "$AWSVPC" ]; then
expose_ip
# Set proxy_arp on the bridge, so that it could accept packets destined
@@ -1956,11 +1960,14 @@ EOF
attach-router)
check_running $CONTAINER_NAME
enforce_docker_bridge_addr_assign_type
# We cannot use detect_awsvpc here, because HTTP server might not be started
! docker inspect -f '{{.Config.Cmd}}' $CONTAINER_NAME | grep -q -- "--awsvpc" || AWSVPC=1
create_bridge
fetch_router_args
setup_router_iface_$BRIDGE_TYPE
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
populate_router
setup_awsvpc
;;
launch-proxy)
deprecation_warnings "$@"