summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-26 15:25:19 +0200
committerGitHub <noreply@github.com>2019-06-26 15:25:19 +0200
commit58a1777f518657ff12744bb69ccf2dab3d429625 (patch)
treea2264182e122e0d0cf29c609bb4856ac5beca7c6 /cmd
parentda1ef2bdfd52e666a2561e0a012cc3a824938e65 (diff)
parente27fef335a4a0d2666542028986100a2f60b3e18 (diff)
downloadpodman-58a1777f518657ff12744bb69ccf2dab3d429625.tar.gz
podman-58a1777f518657ff12744bb69ccf2dab3d429625.tar.bz2
podman-58a1777f518657ff12744bb69ccf2dab3d429625.zip
Merge pull request #3374 from giuseppe/cgroups
cgroups: add initial support for cgroups v2
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/libpodruntime/runtime.go3
-rw-r--r--cmd/podman/main_local.go3
-rw-r--r--cmd/podman/shared/create_cli.go4
3 files changed, 6 insertions, 4 deletions
diff --git a/cmd/podman/libpodruntime/runtime.go b/cmd/podman/libpodruntime/runtime.go
index d83a71250..2d511f7f8 100644
--- a/cmd/podman/libpodruntime/runtime.go
+++ b/cmd/podman/libpodruntime/runtime.go
@@ -5,6 +5,7 @@ import (
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/libpod"
+ "github.com/containers/libpod/pkg/cgroups"
"github.com/containers/libpod/pkg/namespaces"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
@@ -112,7 +113,7 @@ func getRuntime(ctx context.Context, c *cliconfig.PodmanCommand, renumber bool,
if c.Flags().Changed("cgroup-manager") {
options = append(options, libpod.WithCgroupManager(c.GlobalFlags.CGroupManager))
} else {
- unified, err := util.IsCgroup2UnifiedMode()
+ unified, err := cgroups.IsCgroup2UnifiedMode()
if err != nil {
return nil, err
}
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go
index 7a062cb4b..d5f70a28f 100644
--- a/cmd/podman/main_local.go
+++ b/cmd/podman/main_local.go
@@ -13,6 +13,7 @@ import (
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/cmd/podman/libpodruntime"
"github.com/containers/libpod/libpod"
+ "github.com/containers/libpod/pkg/cgroups"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/tracing"
"github.com/containers/libpod/pkg/util"
@@ -31,7 +32,7 @@ func init() {
cgroupManager = runtimeConfig.CgroupManager
}
cgroupHelp := "Cgroup manager to use (cgroupfs or systemd)"
- cgroupv2, _ := util.IsCgroup2UnifiedMode()
+ cgroupv2, _ := cgroups.IsCgroup2UnifiedMode()
if rootless.IsRootless() && !cgroupv2 {
cgroupManager = ""
cgroupHelp = "Cgroup manager is not supported in rootless mode"
diff --git a/cmd/podman/shared/create_cli.go b/cmd/podman/shared/create_cli.go
index 7f158b09a..4bfef8b62 100644
--- a/cmd/podman/shared/create_cli.go
+++ b/cmd/podman/shared/create_cli.go
@@ -5,9 +5,9 @@ import (
"strings"
"github.com/containers/libpod/cmd/podman/shared/parse"
+ "github.com/containers/libpod/pkg/cgroups"
cc "github.com/containers/libpod/pkg/spec"
"github.com/containers/libpod/pkg/sysinfo"
- "github.com/containers/libpod/pkg/util"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@@ -78,7 +78,7 @@ func addWarning(warnings []string, msg string) []string {
func verifyContainerResources(config *cc.CreateConfig, update bool) ([]string, error) {
warnings := []string{}
- cgroup2, err := util.IsCgroup2UnifiedMode()
+ cgroup2, err := cgroups.IsCgroup2UnifiedMode()
if err != nil || cgroup2 {
return warnings, err
}