
This moves container and tasks commands under the containers and tasks top level commands. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
28 lines
555 B
Go
28 lines
555 B
Go
package main
|
|
|
|
import "github.com/urfave/cli"
|
|
|
|
var taskPauseCommand = cli.Command{
|
|
Name: "pause",
|
|
Usage: "pause an existing container",
|
|
ArgsUsage: "CONTAINER",
|
|
Action: func(context *cli.Context) error {
|
|
ctx, cancel := appContext(context)
|
|
defer cancel()
|
|
|
|
client, err := newClient(context)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
container, err := client.LoadContainer(ctx, context.Args().First())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
task, err := container.Task(ctx, nil)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return task.Pause(ctx)
|
|
},
|
|
}
|