From a8192cd76044bb5f82e7ab1d761e34fc21e15432 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Tue, 14 Apr 2020 11:02:42 +0200 Subject: Fix invalid container path comparison for pid cgroup This fixes the behavior to return nil for the PIDs cgroup if the container path is empty. Signed-off-by: Sascha Grunert --- pkg/cgroups/pids.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cgroups/pids.go b/pkg/cgroups/pids.go index 92f82553b..b2bfebe4d 100644 --- a/pkg/cgroups/pids.go +++ b/pkg/cgroups/pids.go @@ -44,7 +44,7 @@ func (c *pidHandler) Destroy(ctr *CgroupControl) error { // Stat fills a metrics structure with usage stats for the controller func (c *pidHandler) Stat(ctr *CgroupControl, m *Metrics) error { - if ctr.path != "" { + if ctr.path == "" { // nothing we can do to retrieve the pids.current path return nil } -- cgit v1.2.3-54-g00ecf