summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-03-15 22:42:04 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-11 14:43:57 +0000
commit15ca5f26878e397056d31e84b4f0937ab173645b (patch)
tree27c61f991325a9c0a4f7e3b6d82b68bcb75451e5 /libpod/container.go
parent6756af386f68e003936d90e1f183fd5eebb47b92 (diff)
downloadpodman-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.go')
-rw-r--r--libpod/container.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpod/container.go b/libpod/container.go
index d9dd9ad12..40e670300 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -39,8 +39,12 @@ const (
ContainerStatePaused ContainerStatus = iota
)
-// DefaultCgroupParent is the default prefix to a cgroup path in libpod
-var DefaultCgroupParent = "/libpod_parent"
+// CgroupfsDefaultCgroupParent is the cgroup parent for CGroupFS in libpod
+const CgroupfsDefaultCgroupParent = "/libpod_parent"
+
+// SystemdDefaultCgroupParent is the cgroup parent for the systemd cgroup
+// manager in libpod
+const SystemdDefaultCgroupParent = "system.slice"
// LinuxNS represents a Linux namespace
type LinuxNS int
@@ -851,7 +855,8 @@ func (c *Container) NamespacePath(ns LinuxNS) (string, error) {
// CGroupPath returns a cgroups "path" for a given container.
func (c *Container) CGroupPath() cgroups.Path {
- return cgroups.StaticPath(filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-conmon-%s/%s", c.ID(), c.ID())))
+ // TODO add support for systemd cgroup paths
+ return cgroups.StaticPath(filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-conmon-%s", c.ID())))
}
// RootFsSize returns the root FS size of the container