Merge remote-tracking branch 'origin/1.5'
This commit is contained in:
commit
c63619bf7d
4 files changed
+20
-1
No files matched your search
@@ -70,3 +70,6 @@
|
|||||||
[submodule "vendor/github.com/pkg/profile"]
|
[submodule "vendor/github.com/pkg/profile"]
|
||||||
path = vendor/github.com/pkg/profile
|
path = vendor/github.com/pkg/profile
|
||||||
url = https://github.com/pkg/profile
|
url = https://github.com/pkg/profile
|
||||||
|
[submodule "vendor/github.com/j-keck/arping"]
|
||||||
|
path = vendor/github.com/j-keck/arping
|
||||||
|
url = https://github.com/j-keck/arping
|
||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/appc/cni/pkg/ipam"
|
"github.com/appc/cni/pkg/ipam"
|
||||||
"github.com/appc/cni/pkg/skel"
|
"github.com/appc/cni/pkg/skel"
|
||||||
"github.com/appc/cni/pkg/types"
|
"github.com/appc/cni/pkg/types"
|
||||||
|
"github.com/j-keck/arping"
|
||||||
"github.com/vishvananda/netlink"
|
"github.com/vishvananda/netlink"
|
||||||
"github.com/vishvananda/netns"
|
"github.com/vishvananda/netns"
|
||||||
weaveapi "github.com/weaveworks/weave/api"
|
weaveapi "github.com/weaveworks/weave/api"
|
||||||
@@ -151,6 +152,7 @@ func setupGuestIP4(origName, name string, ipnet net.IPNet, gw net.IP, routes []t
|
|||||||
if err = netlink.AddrAdd(guest, &netlink.Addr{IPNet: &ipnet}); err != nil {
|
if err = netlink.AddrAdd(guest, &netlink.Addr{IPNet: &ipnet}); err != nil {
|
||||||
return fmt.Errorf("failed to add IP address to %q: %v", name, err)
|
return fmt.Errorf("failed to add IP address to %q: %v", name, err)
|
||||||
}
|
}
|
||||||
|
arping.GratuitousArpOverIfaceByName(ipnet.IP, name)
|
||||||
for _, r := range routes {
|
for _, r := range routes {
|
||||||
if r.GW != nil {
|
if r.GW != nil {
|
||||||
err = addRoute(guest, netlink.SCOPE_UNIVERSE, &r.Dst, r.GW)
|
err = addRoute(guest, netlink.SCOPE_UNIVERSE, &r.Dst, r.GW)
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ start_suite "Test CNI plugin"
|
|||||||
|
|
||||||
cni_connect() {
|
cni_connect() {
|
||||||
pid=$(container_pid $1 $2)
|
pid=$(container_pid $1 $2)
|
||||||
run_on $1 CNI_VERSION=1 CNI_COMMAND=ADD CNI_CONTAINERID=c1 CNI_IFNAME=eth0 \
|
id=$(docker_on $1 inspect -f '{{.Id}}' $2)
|
||||||
|
run_on $1 CNI_VERSION=1 CNI_COMMAND=ADD CNI_CONTAINERID=$id CNI_IFNAME=eth0 \
|
||||||
CNI_NETNS=/proc/$pid/ns/net CNI_PATH=/opt/cni/bin /opt/cni/bin/weave-net
|
CNI_NETNS=/proc/$pid/ns/net CNI_PATH=/opt/cni/bin /opt/cni/bin/weave-net
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,4 +43,16 @@ C2IP=$(container_ip $HOST1 c2)
|
|||||||
assert_raises "exec_on $HOST1 c1 $PING $C2IP"
|
assert_raises "exec_on $HOST1 c1 $PING $C2IP"
|
||||||
assert_raises "exec_on $HOST1 c2 $PING $C1IP"
|
assert_raises "exec_on $HOST1 c2 $PING $C1IP"
|
||||||
|
|
||||||
|
# Now remove and start a new container to see if IP address re-use breaks things
|
||||||
|
docker_on $HOST1 rm -f c2
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
docker_on $HOST1 run --net=none --name=c3 -dt $SMALL_IMAGE /bin/sh
|
||||||
|
|
||||||
|
cni_connect $HOST1 c3 <<EOF
|
||||||
|
{ "name": "weave", "type": "weave-net" }
|
||||||
|
EOF
|
||||||
|
|
||||||
|
assert_raises "exec_on $HOST1 c1 $PING $C2IP"
|
||||||
|
|
||||||
end_suite
|
end_suite
|
||||||
+1
Submodule vendor/github.com/j-keck/arping added at af9a9003cf.
Reference in new issue
Block a user