Merge pull request #569 from bboreham/simplify_parse
Simplify address parsing for populate_dns in weave script
This commit is contained in:
commit
5006839fb8
1 file changed
+1
-2
@@ -489,8 +489,7 @@ populate_dns() {
|
||||
fi
|
||||
for CONTAINER in $(docker ps -q --no-trunc); do
|
||||
MORE_ARGS=$(docker inspect --format='--data-urlencode fqdn={{.Config.Hostname}}.{{.Config.Domainname}}.' $CONTAINER 2>/dev/null) && true
|
||||
if CONTAINER_ADDRS=$(with_container_netns $CONTAINER container_weave_addrs 2>&1) ; then
|
||||
CONTAINER_IPS=$(echo "$CONTAINER_ADDRS" | grep -o 'inet .*' | sed -e 's/inet \([^/]*\)\/\(.*\)/\1/')
|
||||
if CONTAINER_IPS=$(with_container_netns $CONTAINER container_weave_addrs 2>&1 | sed -n -e 's/inet \([^/]*\)\/\(.*\)/\1/p') ; then
|
||||
for IP in $CONTAINER_IPS; do
|
||||
http_call_ip $TARGET_IP $DNS_HTTP_PORT PUT /name/$CONTAINER/$IP $MORE_ARGS
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user