Remove subprocess for changing netns

Now that Go 1.10 has removed the issue which made us do this.
This commit is contained in:
Bryan Boreham committed 2018-04-30 23:40:59 +01:00
1 parent ba578c91a7
commit c2c14410d2
7 files changed
+77 -224

No files matched your search

+3 -1
View File
@@ -49,7 +49,9 @@ func (w *watcher) ContainerStarted(id string) {
rootDir = "/host"
}
netNSPath := weavenet.NSPathByPidWithRoot(rootDir, info.State.Pid)
if _, err := weavenet.WithNetNS(netNSPath, "configure-arp", weavenet.VethName, rootDir); err != nil {
if err := weavenet.WithNetNSByPath(netNSPath, func() error {
return weavenet.ConfigureArp(weavenet.VethName, rootDir)
}); err != nil {
w.driver.warn("ContainerStarted", "unable to configure interfaces: %s", err)
}
}