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 <archana.m.shinde@intel.com>
This commit is contained in:
Archana Shinde 2019-11-08 18:30:11 -08:00
parent d0615f8220
commit f6ffb791e7

View File

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