From 216a0fe4fc48249483a5183ff75184b7f5e9f222 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Thu, 7 Jan 2016 14:29:51 +0000 Subject: [PATCH 1/2] refactor: WEAVE_CIDR=none is redundant when --net=host --- weave | 2 -- 1 file changed, 2 deletions(-) diff --git a/weave b/weave index 7de34242..f70ec5fa 100755 --- a/weave +++ b/weave @@ -124,7 +124,6 @@ exec_remote() { -e DOCKER_CLIENT_HOST="$DOCKER_CLIENT_HOST" \ -e DOCKER_CLIENT_ARGS \ -e PROXY_HOST="$PROXY_HOST" \ - -e WEAVE_CIDR=none \ -e COVERAGE \ $WEAVEEXEC_DOCKER_ARGS $EXEC_IMAGE --local "$@" } @@ -1676,7 +1675,6 @@ launch_proxy() { -v /var/run/weave:/var/run/weave \ -v /proc:/hostproc \ -e PROCFS=/hostproc \ - -e WEAVE_CIDR=none \ -e DOCKER_BRIDGE \ -e WEAVE_DEBUG \ -e COVERAGE \ From e4295a2da970f037e6fb39efd37dfafa9bf0984c Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Thu, 7 Jan 2016 14:32:52 +0000 Subject: [PATCH 2/2] don't attach rewrite_etc_hosts helper container to weave ...since that is a) inefficent and b) can block when IPAM hasn't had consensus. We can only end up in this situation when DOCKER_HOST is pointing at the weave proxy and we are running `weave run|attach` with `--local`. So it's very much an edge case. Fixes #1858. --- weave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weave b/weave index f70ec5fa..c37f332d 100755 --- a/weave +++ b/weave @@ -1169,7 +1169,7 @@ rewrite_etc_hosts() { CONTENTS="$(etc_hosts_contents $FQDN "$@")" # rewrite /etc/hosts, unlinking the file (so Docker does not modify it again) but # leaving it with valid contents... - docker run --rm --net=none --privileged \ + docker run --rm --net=none -e WEAVE_CIDR=none --privileged \ -v $CONTAINERS_PATH:$MNT \ --entrypoint=sh \ $EXEC_IMAGE -c "echo '$CONTENTS' > $MNT_HOSTS && rm -f $MNT_HOSTS && echo '$CONTENTS' > $MNT_HOSTS"