virtcontainers: Unconditionally create the sandbox cgroup manager

Regardless of the sandbox_cgroup_only setting, we create the sandbox
cgroup manager and set the sandbox cgroup path at the same time.

Without doing this, the hypervisor constraint routine is mostly a NOP as
the sandbox state cgroup path is not initialized.

Fixes #2184

Signed-off-by: Samuel Ortiz <samuel.e.ortiz@protonmail.com>
This commit is contained in:
Samuel Ortiz
2021-07-03 11:01:13 +02:00
committed by Samuel Ortiz
parent 967db0cbcc
commit f811026c77
2 changed files with 27 additions and 40 deletions

View File

@@ -84,10 +84,6 @@ func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, f
// Move runtime to sandbox cgroup so all process are created there.
if s.config.SandboxCgroupOnly {
if err := s.createCgroupManager(); err != nil {
return nil, err
}
if err := s.setupSandboxCgroup(); err != nil {
return nil, err
}