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

@@ -21,15 +21,15 @@ command. As part of this process, we do the following:
3. Register metadata for the image.
`,
Flags: append(registryFlags, append(snapshotterFlags, labelFlag)...),
Action: func(clicontext *cli.Context) error {
Action: func(context *cli.Context) error {
var (
ref = clicontext.Args().First()
ref = context.Args().First()
)
ctx, cancel := appContext(clicontext)
ctx, cancel := appContext(context)
defer cancel()
img, err := fetch(ctx, ref, clicontext)
img, err := fetch(ref, context)
if err != nil {
return err
}
@@ -38,7 +38,7 @@ command. As part of this process, we do the following:
// TODO: Show unpack status
fmt.Printf("unpacking %s...\n", img.Target().Digest)
err = img.Unpack(ctx, clicontext.String("snapshotter"))
err = img.Unpack(ctx, context.String("snapshotter"))
if err == nil {
fmt.Println("done")
}