summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go8
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
}