From 5b62b8c1e362dabe77116cdff3f43e457c8916b8 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 19 Jul 2015 22:32:33 +0100 Subject: [PATCH] refactor: inline populate_dns and ditch the wait_for_status, since we've only just called that --- weave | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/weave b/weave index 262b5cc8..e8955312 100755 --- a/weave +++ b/weave @@ -806,19 +806,6 @@ delete_dns_fqdn() { done } -# Tell the newly-started weaveDNS about existing weave IPs -populate_dns() { - if ! wait_for_status $CONTAINER_NAME $HTTP_PORT ; then - echo "If running, it will not be pre-populated." >&2 - return 0 - fi - for CONTAINER in $(docker ps -q --no-trunc) ; do - if CONTAINER_IPS=$(with_container_netns $CONTAINER container_weave_addrs 2>&1 | sed -n -e 's/inet \([^/]*\)\/\(.*\)/\1/p') ; then - with_container_fqdn $CONTAINER put_dns_fqdn $CONTAINER_IPS - fi - done -} - ###################################################################### # IP Allocation Management helpers ###################################################################### @@ -1102,7 +1089,12 @@ launch_router() { # Tell the newly-started weave IP allocator about existing weave IPs with_container_addresses ipam_claim weave:expose $(docker ps -q --no-trunc) fi - populate_dns + # Tell the newly-started weaveDNS about existing weave IPs + for CONTAINER in $(docker ps -q --no-trunc) ; do + if CONTAINER_IPS=$(with_container_netns $CONTAINER container_weave_addrs 2>&1 | sed -n -e 's/inet \([^/]*\)\/\(.*\)/\1/p') ; then + with_container_fqdn $CONTAINER put_dns_fqdn $CONTAINER_IPS + fi + done } launch_proxy() {