more precise detection of weave-attached-ness
Rather than looking for the host end of the veth pair, we look for the expected interface inside the container. This has the advantage of detecting weave-attached-ness even when the container is sharing a network namespace with others. Closes #303, #302.
This commit is contained in:
1 parent
7cfb79cfc1
commit
70eea06de0
1 file changed
+2
-2
@@ -227,8 +227,8 @@ launch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attach() {
|
attach() {
|
||||||
if ip link show $LOCAL_IFNAME >/dev/null 2>&1 ; then
|
if ip netns exec $NETNS ip link show $CONTAINER_IFNAME >/dev/null 2>&1 ; then
|
||||||
# veth name already exists, so assume we set it up already;
|
# container already has the expected network interface, so assume we set it up already;
|
||||||
# just add the IP address.
|
# just add the IP address.
|
||||||
if ip netns exec $NETNS ip addr show dev $CONTAINER_IFNAME | grep -F $1 >/dev/null ; then
|
if ip netns exec $NETNS ip addr show dev $CONTAINER_IFNAME | grep -F $1 >/dev/null ; then
|
||||||
# address was there already
|
# address was there already
|
||||||
|
|||||||
Reference in new issue
Block a user