diff --git a/common/utils.go b/common/utils.go index 8f6615c3..1f52a397 100644 --- a/common/utils.go +++ b/common/utils.go @@ -109,19 +109,13 @@ func GetWeaveNetDevs(processID int) ([]NetDev, error) { return nil, nil } - var weaveBridge netlink.Link - forEachLink(func(link netlink.Link) error { - if link.Attrs().Name == "weave" { - weaveBridge = link - } - return nil - }) - if weaveBridge == nil { - return nil, fmt.Errorf("Cannot find weave bridge") + weaveBridge, err := netlink.LinkByName("weave") + if err != nil { + return nil, fmt.Errorf("Cannot find weave bridge: %s", err) } // Scan devices in root namespace to find those attached to weave bridge indexes := make(map[int]struct{}) - err := forEachLink(func(link netlink.Link) error { + err = forEachLink(func(link netlink.Link) error { if link.Attrs().MasterIndex == weaveBridge.Attrs().Index { indexes[link.Attrs().Index] = struct{}{} } diff --git a/prog/plugin/main.go b/prog/plugin/main.go index 5e30e356..4af2a4b3 100644 --- a/prog/plugin/main.go +++ b/prog/plugin/main.go @@ -26,7 +26,8 @@ var version = "(unreleased version)" func main() { var ( justVersion bool - cniNet, cniIpam bool + cniNet bool + cniIpam bool address string meshAddress string logLevel string