From ca87f8ada3d8f5c58e560572bf750469c2746eaf Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 29 Sep 2016 14:06:43 +0100 Subject: [PATCH] Improve comments --- common/utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/utils.go b/common/utils.go index 281699a6..8ea9fdf6 100644 --- a/common/utils.go +++ b/common/utils.go @@ -125,7 +125,7 @@ func ConnectedToBridgePredicate(bridgeName string) (func(link netlink.Link) bool } func GetNetDevsWithPredicate(processID int, predicate func(link netlink.Link) bool) ([]NetDev, error) { - // Bail out if this container is running in the root namespace + // Bail out if this process is running in the root namespace nsToplevel, err := netns.GetFromPid(1) if err != nil { return nil, fmt.Errorf("unable to open root namespace: %s", err) @@ -133,6 +133,7 @@ func GetNetDevsWithPredicate(processID int, predicate func(link netlink.Link) bo defer nsToplevel.Close() nsContainr, err := netns.GetFromPid(processID) if err != nil { + // Unable to find a namespace for this process - just return nothing if os.IsNotExist(err) { return nil, nil }