Replace usage of WithNetNSUnsafe in plugin/net/watcher.go with safer version

Unsafe version was in ConfigureARPforVeths; replacement is via `weaveutil configure-arp`
This commit is contained in:
Martynas Pumputis authored and Bryan Boreham committed 2016-10-06 15:25:05 +01:00
1 parent 7f92c8c4c6
commit 4a49ff3083
4 files changed
+37 -20

No files matched your search

+1 -2
View File
@@ -4,7 +4,6 @@ import (
"fmt"
weaveapi "github.com/weaveworks/weave/api"
"github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/common/docker"
weavenet "github.com/weaveworks/weave/net"
)
@@ -46,7 +45,7 @@ func (w *watcher) ContainerStarted(id string) {
if err := w.weave.RegisterWithDNS(id, fqdn, net.IPAddress); err != nil {
w.driver.warn("ContainerStarted", "unable to register %s with weaveDNS: %s", id, err)
}
if err := common.ConfigureARPforVeths(info.State.Pid, weavenet.VethName); err != nil {
if _, err := weavenet.WithNetNSByPid(info.State.Pid, "configure-arp", weavenet.VethName); err != nil {
w.driver.warn("ContainerStarted", "unable to configure interfaces: %s", err)
}
}