Refactor newClient in ctr

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-10-23 13:38:15 -04:00
parent edf4114d55
commit 9f76083a8f
30 changed files with 299 additions and 450 deletions

View File

@@ -19,19 +19,15 @@ var taskCheckpointCommand = cli.Command{
},
},
Action: func(context *cli.Context) error {
var (
ctx, cancel = appContext(context)
id = context.Args().First()
)
defer cancel()
id := context.Args().First()
if id == "" {
return errors.New("container id must be provided")
}
client, err := newClient(context)
client, ctx, cancel, err := newClient(context)
if err != nil {
return err
}
defer cancel()
container, err := client.LoadContainer(ctx, id)
if err != nil {
return err