mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Fix handling of CGroupsParent and CGroupsMode
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -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")`,
|
||||
)
|
||||
|
@ -11,7 +11,7 @@ type ContainerCLIOpts struct {
|
||||
CapAdd []string
|
||||
CapDrop []string
|
||||
CGroupsNS string
|
||||
CGroups string
|
||||
CGroupsMode string
|
||||
CGroupParent string
|
||||
CIDFile string
|
||||
ConmonPIDFile string
|
||||
|
@ -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{
|
||||
|
Reference in New Issue
Block a user