diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-21 14:27:21 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-21 16:00:45 -0400 |
commit | 9d7b5947b9ff661433c4bedc018f5368830abbe6 (patch) | |
tree | a8052869b2da7299b42e10ca6530f7cc88eb5783 /cmd | |
parent | f7fe424e19c6d95da6366be966457640bbcfd2e6 (diff) | |
download | podman-9d7b5947b9ff661433c4bedc018f5368830abbe6.tar.gz podman-9d7b5947b9ff661433c4bedc018f5368830abbe6.tar.bz2 podman-9d7b5947b9ff661433c4bedc018f5368830abbe6.zip |
Fix handling of CGroupsParent and CGroupsMode
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/common/create.go | 2 | ||||
-rw-r--r-- | cmd/podman/common/create_opts.go | 2 | ||||
-rw-r--r-- | cmd/podman/common/specgen.go | 7 |
3 files changed, 5 insertions, 6 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index f256d9677..f4c7059d1 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -55,7 +55,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "cgroup namespace to use", ) createFlags.StringVar( - &cf.CGroups, + &cf.CGroupsMode, "cgroups", containerConfig.Cgroups(), `control container cgroup configuration ("enabled"|"disabled"|"no-conmon")`, ) diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 9d12e4b26..37fe01460 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -11,7 +11,7 @@ type ContainerCLIOpts struct { CapAdd []string CapDrop []string CGroupsNS string - CGroups string + CGroupsMode string CGroupParent string CIDFile string ConmonPIDFile string diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 12fd16551..e8e889e66 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -124,7 +124,7 @@ func getPidsLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string) pids.Limit = c.PIDsLimit hasLimits = true } - if c.CGroups == "disabled" && c.PIDsLimit > 0 { + if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 { s.ResourceLimits.Pids.Limit = -1 } if !hasLimits { @@ -473,12 +473,11 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string if ld := c.LogDriver; len(ld) > 0 { s.LogConfiguration.Driver = ld } + s.CgroupParent = c.CGroupParent + s.CgroupsMode = c.CGroupsMode // TODO WTF //cgroup := &cc.CgroupConfig{ - // Cgroups: c.String("cgroups"), // Cgroupns: c.String("cgroupns"), - // CgroupParent: c.String("cgroup-parent"), - // CgroupMode: cgroupMode, //} // //userns := &cc.UserConfig{ |