mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Push up createConfig.CgroupParent processing to parent
Signed-off-by: Jhon Honce <jhonce@redhat.com> Closes: #370 Approved by: rhatdan
This commit is contained in:
@ -72,7 +72,13 @@ func runCmd(c *cli.Context) error {
|
|||||||
options = append(options, libpod.WithUser(createConfig.User))
|
options = append(options, libpod.WithUser(createConfig.User))
|
||||||
options = append(options, libpod.WithShmDir(createConfig.ShmDir))
|
options = append(options, libpod.WithShmDir(createConfig.ShmDir))
|
||||||
options = append(options, libpod.WithShmSize(createConfig.Resources.ShmSize))
|
options = append(options, libpod.WithShmSize(createConfig.Resources.ShmSize))
|
||||||
options = append(options, libpod.WithCgroupParent(createConfig.CgroupParent))
|
|
||||||
|
// Default used if not overridden on command line
|
||||||
|
|
||||||
|
if createConfig.CgroupParent != "" {
|
||||||
|
options = append(options, libpod.WithCgroupParent(createConfig.CgroupParent))
|
||||||
|
}
|
||||||
|
|
||||||
ctr, err := runtime.NewContainer(runtimeSpec, options...)
|
ctr, err := runtime.NewContainer(runtimeSpec, options...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -656,7 +656,6 @@ func WithLogPath(path string) CtrCreateOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WithCgroupParent sets the Cgroup Parent of the new container
|
// WithCgroupParent sets the Cgroup Parent of the new container
|
||||||
// Default used if not overridden on command line
|
|
||||||
func WithCgroupParent(parent string) CtrCreateOption {
|
func WithCgroupParent(parent string) CtrCreateOption {
|
||||||
return func(ctr *Container) error {
|
return func(ctr *Container) error {
|
||||||
if ctr.valid {
|
if ctr.valid {
|
||||||
@ -664,7 +663,7 @@ func WithCgroupParent(parent string) CtrCreateOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if parent == "" {
|
if parent == "" {
|
||||||
return nil
|
return errors.Wrapf(ErrInvalidArg, "cgroup parent cannot be empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctr.config.CgroupParent = parent
|
ctr.config.CgroupParent = parent
|
||||||
|
Reference in New Issue
Block a user