Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #569 from bboreham/simplify_parse
Browse files Browse the repository at this point in the history
Simplify address parsing for populate_dns in weave script
  • Loading branch information
rade committed Apr 17, 2015
2 parents 2332bc9 + 7c68525 commit 5006839
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5006839

Please sign in to comment.