summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-09-25 14:14:27 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-09-27 07:55:16 -0400
commit007c0ecd50846900eaa7b8ea2fde08c83746abda (patch)
tree83dabc69d240b41a0fbecd6a3f80e723cd206240 /cmd/podman
parent03d01abec6d028e9d5f60615b0451e42d0611d1d (diff)
downloadpodman-007c0ecd50846900eaa7b8ea2fde08c83746abda.tar.gz
podman-007c0ecd50846900eaa7b8ea2fde08c83746abda.tar.bz2
podman-007c0ecd50846900eaa7b8ea2fde08c83746abda.zip
Remove SkipIfRootless if possible, document other calls
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/pause.go6
-rw-r--r--cmd/podman/containers/unpause.go6
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")