Reclaim plugin addresses using container ID of '_'
This commit is contained in:
1 parent
260b416cd7
commit
158fa9d8e5
1 file changed
+6
-1
@@ -1382,8 +1382,13 @@ check_overlap() {
|
|||||||
# Claim addresses for a container in IPAM. Expects to be called from
|
# Claim addresses for a container in IPAM. Expects to be called from
|
||||||
# with_container_addresses.
|
# with_container_addresses.
|
||||||
ipam_reclaim() {
|
ipam_reclaim() {
|
||||||
|
CONTAINER_ID="$1"
|
||||||
|
# The weave IP addresses of containers attached by the plugin are
|
||||||
|
# recorded specially in IPAM, since the container id is not know
|
||||||
|
# at the time.
|
||||||
|
[ "$2" = "$CONTAINER_IFNAME" ] || CONTAINER_ID="_"
|
||||||
for CIDR in $4 ; do
|
for CIDR in $4 ; do
|
||||||
http_call $HTTP_ADDR PUT "/ip/$1/$CIDR?noErrorOnUnknown=true&?check-alive=true" || true
|
http_call $HTTP_ADDR PUT "/ip/$CONTAINER_ID/$CIDR?noErrorOnUnknown=true&?check-alive=true" || true
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user