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 <sgrunert@suse.com>
This commit is contained in:
Sascha Grunert
2020-04-14 11:02:42 +02:00
parent 5cf64aee11
commit a8192cd760

View File

@ -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
}