summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-30 14:38:23 -0700
committerGitHub <noreply@github.com>2019-09-30 14:38:23 -0700
commit5702dd7005e55d53db9f707bb3b6de5d70c9ed40 (patch)
tree7df8de2621779678eb8e979ead91aa08ce2c5b77
parentb063383390f8b23f69357d781784582e4d93c706 (diff)
parentb40e44ac1a7df443c8700874d23451682092599b (diff)
downloadpodman-5702dd7005e55d53db9f707bb3b6de5d70c9ed40.tar.gz
podman-5702dd7005e55d53db9f707bb3b6de5d70c9ed40.tar.bz2
podman-5702dd7005e55d53db9f707bb3b6de5d70c9ed40.zip
Merge pull request #4141 from giuseppe/add-cgroups-info
info: add cgroups2
-rw-r--r--libpod/info.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/libpod/info.go b/libpod/info.go
index e5132b5f6..297086ebb 100644
--- a/libpod/info.go
+++ b/libpod/info.go
@@ -13,6 +13,7 @@ import (
"time"
"github.com/containers/buildah"
+ "github.com/containers/libpod/pkg/cgroups"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/utils"
"github.com/containers/storage"
@@ -29,6 +30,15 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
info["arch"] = runtime.GOARCH
info["cpus"] = runtime.NumCPU()
info["rootless"] = rootless.IsRootless()
+ unified, err := cgroups.IsCgroup2UnifiedMode()
+ if err != nil {
+ return nil, errors.Wrapf(err, "error reading cgroups mode")
+ }
+ cgroupVersion := "v1"
+ if unified {
+ cgroupVersion = "v2"
+ }
+ info["CgroupVersion"] = cgroupVersion
mi, err := system.ReadMemInfo()
if err != nil {
return nil, errors.Wrapf(err, "error reading memory info")