From 9cd353ab1f8aae333d10cfd85ca6dffaeb9ae4b4 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 10 Feb 2017 15:08:42 +0000 Subject: [PATCH] Stop collecting addresses in weave script now we do it in Go --- weave | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/weave b/weave index 576b058b06..68d589ef47 100755 --- a/weave +++ b/weave @@ -1304,25 +1304,6 @@ check_overlap() { util_op netcheck $1 $BRIDGE } -# Claim addresses for a container in IPAM. Expects to be called from -# with_container_addresses. -ipam_reclaim() { - CONTAINER_ID="$1" - # The weave IP addresses of containers attached by the plugin are - # recorded specially in IPAM, since the container id is not know - # at the time. - [ "$2" = "$CONTAINER_IFNAME" ] || CONTAINER_ID="_" - for CIDR in $4 ; do - http_call $HTTP_ADDR PUT "/ip/$CONTAINER_ID/$CIDR?noErrorOnUnknown=true&?check-alive=true" || true - done -} - -ipam_reclaim_no_check_alive() { - for CIDR in $4 ; do - http_call $HTTP_ADDR PUT /ip/$1/$CIDR?noErrorOnUnknown=true || true - done -} - detect_awsvpc() { # Ignoring errors here: if we cannot detect AWSVPC we will skip the relevant # steps, because "attach" should work without the weave router running. @@ -1729,17 +1710,10 @@ setup_awsvpc() { # Recreate the parameter values that are set when the router is first launched fetch_router_args() { CONTAINER_ARGS=$(docker inspect -f '{{.Args}}' $CONTAINER_NAME) || return 1 - IPRANGE=$(echo $CONTAINER_ARGS | grep -o -E -e '-ipalloc-range [0-9/.]+') || true NO_DNS_OPT=$(echo $CONTAINER_ARGS | grep -o -e '--no-dns') || true } populate_router() { - if [ -n "$IPRANGE" ] ; then - # Tell the newly-started weave IP allocator about existing weave IPs - # In the case of AWSVPC, we do expose before calling populate_router - [ -n "$AWSVPC" ] || with_container_addresses ipam_reclaim_no_check_alive weave:expose - with_container_addresses ipam_reclaim $(docker ps -q --no-trunc) - fi if [ -z "$NO_DNS_OPT" ] ; then # Tell the newly-started weaveDNS about existing weave IPs for CONTAINER in $(docker ps -q --no-trunc) ; do