From d2884db422ddfde8af7dcaa69e47370641e096a9 Mon Sep 17 00:00:00 2001 From: "Mohamed S. Mahmoud" Date: Thu, 21 Sep 2023 02:53:11 -0400 Subject: [PATCH] NETOBSERV-1317: change netns errors to warnings to avoid confustion (#186) (#187) Signed-off-by: msherif1234 (cherry picked from commit c8c9e6af13ba806aa6fef6f649ea0f126c541cb7) --- pkg/ifaces/watcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ifaces/watcher.go b/pkg/ifaces/watcher.go index 93e2a7e30..12dc12575 100644 --- a/pkg/ifaces/watcher.go +++ b/pkg/ifaces/watcher.go @@ -123,7 +123,7 @@ func getNetNSHandles() ([]netns.NsHandle, error) { log := logrus.WithField("component", "ifaces.Watcher") files, err := os.ReadDir(netnsVolume) if err != nil { - log.WithError(err).Error("can't detect any network-namespaces") + log.Warningf("can't detect any network-namespaces err: %v [Ignore if the agent privileged flag is not set]", err) return nil, fmt.Errorf("failed to list network-namespaces: %w", err) } @@ -188,6 +188,6 @@ func (w *Watcher) netnsNotify(ctx context.Context, out chan Event) { err = w.netnsWatcher.Add(netnsVolume) if err != nil { - log.WithError(err).Error("failed to add watcher to netns directory") + log.Warningf("failed to add watcher to netns directory err: %v [Ignore if the agent privileged flag is not set]", err) } }