From d18ccac43bd19977f918c8eae55413aa88d4e1ef Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Wed, 3 Jun 2015 11:35:23 +0100 Subject: [PATCH] Free IPAM addresses individually in 'weave hide', because the user now has the ability to free some subnets and not others --- weave | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weave b/weave index af4fcfe1..52451017 100755 --- a/weave +++ b/weave @@ -1156,8 +1156,10 @@ case "$COMMAND" in delete_iptables_rule nat WEAVE -s $CIDR ! -d $CIDR -j MASQUERADE when_dns_running delete_dns 'weave:expose' $CIDR fi + # Tell IPAM we don't need this address, but ignore errors because + # the address might not have come from IPAM + http_call $CONTAINER_NAME $HTTP_PORT DELETE /ip/weave:expose/${CIDR%/*} >/dev/null 2>&1 || true done - [ $CIDR_COUNT -eq 0 ] && http_call $CONTAINER_NAME $HTTP_PORT DELETE /ip/weave:expose 2>/dev/null || true ;; stop) [ $# -eq 0 ] || usage