diff options
Diffstat (limited to 'cmd/podman/pause.go')
-rw-r--r-- | cmd/podman/pause.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/podman/pause.go b/cmd/podman/pause.go index cd8370082..ee5fd352d 100644 --- a/cmd/podman/pause.go +++ b/cmd/podman/pause.go @@ -1,11 +1,10 @@ package main import ( - "os" - "github.com/containers/libpod/cmd/podman/cliconfig" - "github.com/containers/libpod/libpod" + "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/adapter" + "github.com/containers/libpod/pkg/rootless" "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -39,7 +38,7 @@ func init() { } func pauseCmd(c *cliconfig.PauseValues) error { - if os.Geteuid() != 0 { + if rootless.IsRootless() && !remoteclient { return errors.New("pause is not supported for rootless containers") } @@ -55,7 +54,7 @@ func pauseCmd(c *cliconfig.PauseValues) error { } ok, failures, err := runtime.PauseContainers(getContext(), c) if err != nil { - if errors.Cause(err) == libpod.ErrNoSuchCtr { + if errors.Cause(err) == define.ErrNoSuchCtr { if len(c.InputArgs) > 1 { exitCode = 125 } else { |