From f6ffb791e713c0c7d7617caeb6e72cf676a861c1 Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Fri, 8 Nov 2019 18:30:11 -0800 Subject: [PATCH] rootless: Fix cgroup creation logic for rootless We do not want to create cgroups in case of rootless. Fix the logic to implement this. Fixes #2177 Signed-off-by: Archana Shinde --- virtcontainers/container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtcontainers/container.go b/virtcontainers/container.go index aff4e8569..701d5c678 100644 --- a/virtcontainers/container.go +++ b/virtcontainers/container.go @@ -916,7 +916,7 @@ func (c *Container) create() (err error) { } c.process = *process - if !c.sandbox.config.SandboxCgroupOnly || !rootless.IsRootless() { + if !rootless.IsRootless() && !c.sandbox.config.SandboxCgroupOnly { if err = c.cgroupsCreate(); err != nil { return }