summaryrefslogtreecommitdiff
path: root/libpod/container_config.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-10-08 15:25:06 -0400
committerMatthew Heon <matthew.heon@pm.me>2020-10-08 15:25:06 -0400
commit4d800a5f45abba9c17d4b3a4c04af563c9a2f4da (patch)
tree1416ebe6b6fdad3b56153971e530a2697eb63693 /libpod/container_config.go
parent59b5f0ac32ddf615fada021bc62c823bb73233da (diff)
downloadpodman-4d800a5f45abba9c17d4b3a4c04af563c9a2f4da.tar.gz
podman-4d800a5f45abba9c17d4b3a4c04af563c9a2f4da.tar.bz2
podman-4d800a5f45abba9c17d4b3a4c04af563c9a2f4da.zip
Store cgroup manager on a per-container basis
When we create a container, we assign a cgroup parent based on the current cgroup manager in use. This parent is only usable with the cgroup manager the container is created with, so if the default cgroup manager is later changed or overridden, the container will not be able to start. To solve this, store the cgroup manager that created the container in container configuration, so we can guarantee a container with a systemd cgroup parent will always be started with systemd cgroups. Unfortunately, this is very difficult to test in CI, due to the fact that we hard-code cgroup manager on all invocations of Podman in CI. Fixes #7830 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/container_config.go')
-rw-r--r--libpod/container_config.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpod/container_config.go b/libpod/container_config.go
index fc93140dd..e264da4da 100644
--- a/libpod/container_config.go
+++ b/libpod/container_config.go
@@ -275,13 +275,16 @@ type ContainerMiscConfig struct {
StopTimeout uint `json:"stopTimeout,omitempty"`
// Time container was created
CreatedTime time.Time `json:"createdTime"`
+ // CgroupManager is the cgroup manager used to create this container.
+ // If empty, the runtime default will be used.
+ CgroupManager string `json:"cgroupManager,omitempty"`
// NoCgroups indicates that the container will not create CGroups. It is
// incompatible with CgroupParent. Deprecated in favor of CgroupsMode.
NoCgroups bool `json:"noCgroups,omitempty"`
// CgroupsMode indicates how the container will create cgroups
// (disabled, no-conmon, enabled). It supersedes NoCgroups.
CgroupsMode string `json:"cgroupsMode,omitempty"`
- // Cgroup parent of the container
+ // Cgroup parent of the container.
CgroupParent string `json:"cgroupParent"`
// LogPath log location
LogPath string `json:"logPath"`