From ea83ff1fc32c6619038908bfa7a5fa90dba0e7e0 Mon Sep 17 00:00:00 2001 From: Snir Sheriber Date: Mon, 1 Nov 2021 09:34:10 +0200 Subject: [PATCH] runtime: remove prefix when cgroups are managed by systemd as done previously in 9949daf4dcba2d39cd0de6b4dc425570b2648cc1 Backport-from: #2959 Signed-off-by: Snir Sheriber --- src/runtime/virtcontainers/sandbox.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/virtcontainers/sandbox.go b/src/runtime/virtcontainers/sandbox.go index 6b34d597c6..36291644ce 100644 --- a/src/runtime/virtcontainers/sandbox.go +++ b/src/runtime/virtcontainers/sandbox.go @@ -590,9 +590,11 @@ func (s *Sandbox) createCgroups() error { // CPUSet. // For the sandbox cgroups we create and manage, rename the base of the cgroup path to // include "kata_" - cgroupPath, err = cgroups.RenameCgroupPath(cgroupPath) - if err != nil { - return err + if !cgroups.IsSystemdCgroup(cgroupPath) { // don't add prefix when cgroups are managed by systemd + cgroupPath, err = cgroups.RenameCgroupPath(cgroupPath) + if err != nil { + return err + } } if spec.Linux.Resources != nil {