feed full container id on weave start to DNS/IPAM

We erroneously assumed that `docker start` returned the full container
id. It doesn't and as a result we populated DNS with records with ids
other than full container ids. And that's also what we told IPAM. As a
result, DNS and IPAM didn't clean up after the container's death,
resulting in stale DNS entries and leaked IPs.

Fixes #881.
This commit is contained in:
Matthias Radestock committed 2015-06-10 14:53:43 +01:00
1 parent 0ab7c31bbe
commit 7a2b5c43e7
2 files changed
+36 -2

No files matched your search

+3 -2
View File
@@ -1023,12 +1023,13 @@ case "$COMMAND" in
collect_cidr_args "$@"
shift $CIDR_COUNT
[ $# -eq 1 ] || usage
CONTAINER=$(docker start $1)
RES=$(docker start $1)
CONTAINER=$(container_id $1)
create_bridge
get_ipam_cidr $CONTAINER
with_container_netns_or_die $CONTAINER attach $CIDR_ARGS
when_dns_running with_container_fqdn $CONTAINER put_dns_fqdn $CIDR_ARGS
echo $CONTAINER
echo $RES
;;
attach)
collect_cidr_args "$@"