summaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-06-19 14:22:09 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-06-26 13:17:06 +0200
commite27fef335a4a0d2666542028986100a2f60b3e18 (patch)
treec60a3a502498929a272bf4af8906063dcecacc40 /libpod/container_internal_linux.go
parent1778bfa5fef337158537a77344300e1a755a7ffe (diff)
downloadpodman-e27fef335a4a0d2666542028986100a2f60b3e18.tar.gz
podman-e27fef335a4a0d2666542028986100a2f60b3e18.tar.bz2
podman-e27fef335a4a0d2666542028986100a2f60b3e18.zip
stats: fix cgroup path for rootless containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 1ea858886..e93e0cad8 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -23,6 +23,7 @@ import (
"github.com/containers/libpod/libpod/define"
crioAnnotations "github.com/containers/libpod/pkg/annotations"
"github.com/containers/libpod/pkg/apparmor"
+ "github.com/containers/libpod/pkg/cgroups"
"github.com/containers/libpod/pkg/criu"
"github.com/containers/libpod/pkg/lookup"
"github.com/containers/libpod/pkg/resolvconf"
@@ -350,7 +351,11 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
g.AddProcessEnv("container", "libpod")
}
- if rootless.IsRootless() {
+ unified, err := cgroups.IsCgroup2UnifiedMode()
+ if err != nil {
+ return nil, err
+ }
+ if rootless.IsRootless() && !unified {
g.SetLinuxCgroupsPath("")
} else if c.runtime.config.CgroupManager == SystemdCgroupsManager {
// When runc is set to use Systemd as a cgroup manager, it