diff options
author | Brent Baude <bbaude@redhat.com> | 2020-04-16 12:25:26 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-04-16 15:53:58 -0500 |
commit | 241326a9a8c20ad7f2bcf651416b836e7778e090 (patch) | |
tree | 4001e8e47a022bb1b9bfbf2332c42e1aeb802f9e /cmd/podman/unpause.go | |
parent | 88c6fd06cd54fb9a8826306dfdf1a77e400de5de (diff) | |
download | podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.gz podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.bz2 podman-241326a9a8c20ad7f2bcf651416b836e7778e090.zip |
Podman V2 birth
remote podman v1 and replace with podman v2.
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/unpause.go')
-rw-r--r-- | cmd/podman/unpause.go | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/cmd/podman/unpause.go b/cmd/podman/unpause.go deleted file mode 100644 index ae24b0e66..000000000 --- a/cmd/podman/unpause.go +++ /dev/null @@ -1,69 +0,0 @@ -package main - -import ( - "github.com/containers/libpod/cmd/podman/cliconfig" - "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" -) - -var ( - unpauseCommand cliconfig.UnpauseValues - - unpauseDescription = `Unpauses one or more previously paused containers. The container name or ID can be used.` - _unpauseCommand = &cobra.Command{ - Use: "unpause [flags] CONTAINER [CONTAINER...]", - Short: "Unpause the processes in one or more containers", - Long: unpauseDescription, - RunE: func(cmd *cobra.Command, args []string) error { - unpauseCommand.InputArgs = args - unpauseCommand.GlobalFlags = MainGlobalOpts - unpauseCommand.Remote = remoteclient - return unpauseCmd(&unpauseCommand) - }, - Example: `podman unpause ctrID - podman unpause --all`, - } -) - -func init() { - unpauseCommand.Command = _unpauseCommand - unpauseCommand.SetHelpTemplate(HelpTemplate()) - unpauseCommand.SetUsageTemplate(UsageTemplate()) - flags := unpauseCommand.Flags() - flags.BoolVarP(&unpauseCommand.All, "all", "a", false, "Unpause all paused containers") -} - -func unpauseCmd(c *cliconfig.UnpauseValues) error { - if rootless.IsRootless() && !remoteclient { - return errors.New("unpause is not supported for rootless containers") - } - - runtime, err := adapter.GetRuntime(getContext(), &c.PodmanCommand) - if err != nil { - return errors.Wrapf(err, "could not get runtime") - } - defer runtime.DeferredShutdown(false) - - args := c.InputArgs - if len(args) < 1 && !c.All { - return errors.Errorf("you must provide at least one container name or id") - } - ok, failures, err := runtime.UnpauseContainers(getContext(), c) - if err != nil { - if errors.Cause(err) == define.ErrNoSuchCtr { - if len(c.InputArgs) > 1 { - exitCode = define.ExecErrorCodeGeneric - } else { - exitCode = 1 - } - } - return err - } - if len(failures) > 0 { - exitCode = define.ExecErrorCodeGeneric - } - return printCmdResults(ok, failures) -} |