mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Add validation for CGroup parents. Pass CGroups path into runc
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #507 Approved by: baude
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user