diff options
Diffstat (limited to 'pkg/specgenutil/specgen.go')
-rw-r--r-- | pkg/specgenutil/specgen.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index bb9d5d1f9..59ac19c2c 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -8,6 +8,7 @@ import ( "strings" "time" + "github.com/containers/common/pkg/config" "github.com/containers/image/v5/manifest" "github.com/containers/podman/v3/cmd/podman/parse" "github.com/containers/podman/v3/libpod/define" @@ -490,6 +491,14 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions } s.CgroupParent = c.CgroupParent s.CgroupsMode = c.CgroupsMode + if s.CgroupsMode == "" { + rtc, err := config.Default() + if err != nil { + return err + } + + s.CgroupsMode = rtc.Cgroups() + } s.Groups = c.GroupAdd |