diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-03-15 22:42:04 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-11 14:43:57 +0000 |
commit | 15ca5f26878e397056d31e84b4f0937ab173645b (patch) | |
tree | 27c61f991325a9c0a4f7e3b6d82b68bcb75451e5 /libpod/container_internal.go | |
parent | 6756af386f68e003936d90e1f183fd5eebb47b92 (diff) | |
download | podman-15ca5f26878e397056d31e84b4f0937ab173645b.tar.gz podman-15ca5f26878e397056d31e84b4f0937ab173645b.tar.bz2 podman-15ca5f26878e397056d31e84b4f0937ab173645b.zip |
Add validation for CGroup parents. Pass CGroups path into runc
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Closes: #507
Approved by: baude
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 5417c8a4f..644598322 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -160,7 +160,6 @@ func newContainer(rspec *spec.Spec, lockDir string) (*Container, error) { ctr.config.CreatedTime = time.Now() ctr.config.ShmSize = DefaultShmSize - ctr.config.CgroupParent = DefaultCgroupParent ctr.state.BindMounts = make(map[string]string) @@ -1129,6 +1128,13 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { g.AddProcessEnv("container", "libpod") } + cgroupPath, err := c.CGroupPath()("") + if err != nil { + return nil, errors.Wrapf(err, "error retrieving CGroup path for container %s", c.ID()) + } + logrus.Debugf("Setting CGroup path for container %s to %s", c.ID(), cgroupPath) + g.SetLinuxCgroupsPath(cgroupPath) + return g.Spec(), nil } |