From 607cb80bf77642c02b80bff56aa4c3e396a91fa0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 13 Jan 2022 14:52:56 -0500 Subject: Fix cgroup mode handling in api server Also change code to globably be consistent when refering to capatilized Cgroup. Fixed: https://github.com/containers/podman/issues/12550 Signed-off-by: Daniel J Walsh --- pkg/specgen/generate/container.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/specgen/generate') diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go index 2c7b3c091..7b55a0cb3 100644 --- a/pkg/specgen/generate/container.go +++ b/pkg/specgen/generate/container.go @@ -229,6 +229,10 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat } } + if s.CgroupsMode == "" { + s.CgroupsMode = rtc.Cgroups() + } + // If caller did not specify Pids Limits load default if s.ResourceLimits == nil || s.ResourceLimits.Pids == nil { if s.CgroupsMode != "disabled" { -- cgit v1.2.3-54-g00ecf