diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-28 14:43:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 14:43:46 +0000 |
commit | b0e70a6411d70d7ee7f1e9d6abedc2524b903609 (patch) | |
tree | 6987290e36b8782fe12ff4506bdc017d4b32de60 /cmd/podman | |
parent | d2802636b0a7e3d281e52b44676de5e3226fbabf (diff) | |
parent | 007c0ecd50846900eaa7b8ea2fde08c83746abda (diff) | |
download | podman-b0e70a6411d70d7ee7f1e9d6abedc2524b903609.tar.gz podman-b0e70a6411d70d7ee7f1e9d6abedc2524b903609.tar.bz2 podman-b0e70a6411d70d7ee7f1e9d6abedc2524b903609.zip |
Merge pull request #7786 from rhatdan/rootless
Remove SkipIfRootless if possible, document other calls
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/containers/pause.go | 6 | ||||
-rw-r--r-- | cmd/podman/containers/unpause.go | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/cmd/podman/containers/pause.go b/cmd/podman/containers/pause.go index c2218bc44..c5171303d 100644 --- a/cmd/podman/containers/pause.go +++ b/cmd/podman/containers/pause.go @@ -6,6 +6,7 @@ import ( "github.com/containers/podman/v2/cmd/podman/registry" "github.com/containers/podman/v2/cmd/podman/utils" + "github.com/containers/podman/v2/pkg/cgroups" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/containers/podman/v2/pkg/rootless" "github.com/pkg/errors" @@ -64,7 +65,10 @@ func pause(cmd *cobra.Command, args []string) error { errs utils.OutputErrors ) if rootless.IsRootless() && !registry.IsRemote() { - return errors.New("pause is not supported for rootless containers") + cgroupv2, _ := cgroups.IsCgroup2UnifiedMode() + if !cgroupv2 { + return errors.New("pause is not supported for cgroupv1 rootless containers") + } } if len(args) < 1 && !pauseOpts.All { diff --git a/cmd/podman/containers/unpause.go b/cmd/podman/containers/unpause.go index 50113669c..43eaad72b 100644 --- a/cmd/podman/containers/unpause.go +++ b/cmd/podman/containers/unpause.go @@ -6,6 +6,7 @@ import ( "github.com/containers/podman/v2/cmd/podman/registry" "github.com/containers/podman/v2/cmd/podman/utils" + "github.com/containers/podman/v2/pkg/cgroups" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/containers/podman/v2/pkg/rootless" "github.com/pkg/errors" @@ -62,7 +63,10 @@ func unpause(cmd *cobra.Command, args []string) error { errs utils.OutputErrors ) if rootless.IsRootless() && !registry.IsRemote() { - return errors.New("unpause is not supported for rootless containers") + cgroupv2, _ := cgroups.IsCgroup2UnifiedMode() + if !cgroupv2 { + return errors.New("unpause is not supported for cgroupv1 rootless containers") + } } if len(args) < 1 && !unPauseOptions.All { return errors.Errorf("you must provide at least one container name or id") |