diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-10-08 15:25:06 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-10-08 15:25:06 -0400 |
commit | 4d800a5f45abba9c17d4b3a4c04af563c9a2f4da (patch) | |
tree | 1416ebe6b6fdad3b56153971e530a2697eb63693 /libpod/runtime_ctr.go | |
parent | 59b5f0ac32ddf615fada021bc62c823bb73233da (diff) | |
download | podman-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/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index abb97293f..51b4c5f03 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -208,6 +208,7 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai // Check CGroup parent sanity, and set it if it was not set. // Only if we're actually configuring CGroups. if !ctr.config.NoCgroups { + ctr.config.CgroupManager = r.config.Engine.CgroupManager switch r.config.Engine.CgroupManager { case config.CgroupfsCgroupsManager: if ctr.config.CgroupParent == "" { |