mirror of
https://github.com/containers/podman.git
synced 2025-06-19 16:33:24 +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",
|
"cgroup namespace to use",
|
||||||
)
|
)
|
||||||
createFlags.StringVar(
|
createFlags.StringVar(
|
||||||
&cf.CGroups,
|
&cf.CGroupsMode,
|
||||||
"cgroups", containerConfig.Cgroups(),
|
"cgroups", containerConfig.Cgroups(),
|
||||||
`control container cgroup configuration ("enabled"|"disabled"|"no-conmon")`,
|
`control container cgroup configuration ("enabled"|"disabled"|"no-conmon")`,
|
||||||
)
|
)
|
||||||
|
@ -11,7 +11,7 @@ type ContainerCLIOpts struct {
|
|||||||
CapAdd []string
|
CapAdd []string
|
||||||
CapDrop []string
|
CapDrop []string
|
||||||
CGroupsNS string
|
CGroupsNS string
|
||||||
CGroups string
|
CGroupsMode string
|
||||||
CGroupParent string
|
CGroupParent string
|
||||||
CIDFile string
|
CIDFile string
|
||||||
ConmonPIDFile string
|
ConmonPIDFile string
|
||||||
|
@ -124,7 +124,7 @@ func getPidsLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string)
|
|||||||
pids.Limit = c.PIDsLimit
|
pids.Limit = c.PIDsLimit
|
||||||
hasLimits = true
|
hasLimits = true
|
||||||
}
|
}
|
||||||
if c.CGroups == "disabled" && c.PIDsLimit > 0 {
|
if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
|
||||||
s.ResourceLimits.Pids.Limit = -1
|
s.ResourceLimits.Pids.Limit = -1
|
||||||
}
|
}
|
||||||
if !hasLimits {
|
if !hasLimits {
|
||||||
@ -473,12 +473,11 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
|
|||||||
if ld := c.LogDriver; len(ld) > 0 {
|
if ld := c.LogDriver; len(ld) > 0 {
|
||||||
s.LogConfiguration.Driver = ld
|
s.LogConfiguration.Driver = ld
|
||||||
}
|
}
|
||||||
|
s.CgroupParent = c.CGroupParent
|
||||||
|
s.CgroupsMode = c.CGroupsMode
|
||||||
// TODO WTF
|
// TODO WTF
|
||||||
//cgroup := &cc.CgroupConfig{
|
//cgroup := &cc.CgroupConfig{
|
||||||
// Cgroups: c.String("cgroups"),
|
|
||||||
// Cgroupns: c.String("cgroupns"),
|
// Cgroupns: c.String("cgroupns"),
|
||||||
// CgroupParent: c.String("cgroup-parent"),
|
|
||||||
// CgroupMode: cgroupMode,
|
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
//userns := &cc.UserConfig{
|
//userns := &cc.UserConfig{
|
||||||
|
Reference in New Issue
Block a user