diff options
Diffstat (limited to 'cmd/podman/unpause.go')
-rw-r--r-- | cmd/podman/unpause.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cmd/podman/unpause.go b/cmd/podman/unpause.go index 2cd6846fe..382b64e97 100644 --- a/cmd/podman/unpause.go +++ b/cmd/podman/unpause.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" ) @@ -38,7 +37,7 @@ func init() { } func unpauseCmd(c *cliconfig.UnpauseValues) error { - if os.Geteuid() != 0 { + if rootless.IsRootless() && !remoteclient { return errors.New("unpause is not supported for rootless containers") } @@ -46,7 +45,7 @@ func unpauseCmd(c *cliconfig.UnpauseValues) error { if err != nil { return errors.Wrapf(err, "could not get runtime") } - defer runtime.Shutdown(false) + defer runtime.DeferredShutdown(false) args := c.InputArgs if len(args) < 1 && !c.All { @@ -54,7 +53,7 @@ func unpauseCmd(c *cliconfig.UnpauseValues) error { } ok, failures, err := runtime.UnpauseContainers(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 { |