Store address+subnet prefix for 'owned' addresses

This commit is contained in:
Bryan Boreham committed 2016-03-02 17:21:24 -08:00
1 parent b6eec08247
commit b76e2a87cf
7 files changed
+100 -104

No files matched your search

+3 -3
View File
@@ -1298,7 +1298,7 @@ check_overlap() {
# with_container_addresses.
ipam_reclaim() {
for CIDR in $3 ; do
http_call $HTTP_ADDR PUT /ip/$1/${CIDR%/*}?noErrorOnUnknown=true
http_call $HTTP_ADDR PUT /ip/$1/$CIDR?noErrorOnUnknown=true
done
}
@@ -1354,7 +1354,7 @@ ipam_cidrs() {
if [ "$METHOD" = "POST" ] ; then
# Assignment of a plain IP address; warn if it clashes but carry on
check_overlap $arg || true
when_weave_running http_call $HTTP_ADDR PUT /ip/$CONTAINER_ID/${arg%/*} >&2
when_weave_running http_call $HTTP_ADDR PUT /ip/$CONTAINER_ID/$arg >&2
fi
ALL_CIDRS="$ALL_CIDRS $arg"
fi
@@ -2064,7 +2064,7 @@ EOF
RES=$(docker restart $1)
CONTAINER=$(container_id $1)
for CIDR in $ALL_CIDRS ; do
call_weave PUT /ip/$CONTAINER/${CIDR%/*}
call_weave PUT /ip/$CONTAINER/$CIDR
done
with_container_netns_or_die $1 attach $ALL_CIDRS
when_weave_running with_container_fqdn $1 put_dns_fqdn $ALL_CIDRS