From d856210ea85269bdc23bb694f8828d89d2802f84 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 19 Aug 2020 14:11:16 +0200 Subject: podman: add option --cgroup-conf it allows to manually tweak the configuration for cgroup v2. we will expose some of the options in future as single options (e.g. the new memory knobs), but for now add the more generic --cgroup-conf mechanism for maximum control on the cgroup configuration. OCI specs change: https://github.com/opencontainers/runtime-spec/pull/1040 Requires: https://github.com/containers/crun/pull/459 Signed-off-by: Giuseppe Scrivano --- libpod/container_inspect.go | 1 + libpod/define/container_inspect.go | 2 ++ 2 files changed, 3 insertions(+) (limited to 'libpod') diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index 437729c2d..835dccd71 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -465,6 +465,7 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named if ctrSpec.Linux.Resources.Pids != nil { hostConfig.PidsLimit = ctrSpec.Linux.Resources.Pids.Limit } + hostConfig.CgroupConf = ctrSpec.Linux.Resources.Unified if ctrSpec.Linux.Resources.BlockIO != nil { if ctrSpec.Linux.Resources.BlockIO.Weight != nil { hostConfig.BlkioWeight = *ctrSpec.Linux.Resources.BlockIO.Weight diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go index 8adf3c077..44c3d515b 100644 --- a/libpod/define/container_inspect.go +++ b/libpod/define/container_inspect.go @@ -518,6 +518,8 @@ type InspectContainerHostConfig struct { IOMaximumIOps uint64 `json:"IOMaximumIOps"` // IOMaximumBandwidth is Windows-only and not presently implemented. IOMaximumBandwidth uint64 `json:"IOMaximumBandwidth"` + // CgroupConf is the configuration for cgroup v2. + CgroupConf map[string]string `json:"CgroupConf"` } // InspectBasicNetworkConfig holds basic configuration information (e.g. IP -- cgit v1.2.3-54-g00ecf