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

@@ -90,8 +90,13 @@ func appContext(clicontext *cli.Context) (gocontext.Context, gocontext.CancelFun
return ctx, cancel
}
func newClient(context *cli.Context) (*containerd.Client, error) {
return containerd.New(context.GlobalString("address"))
func newClient(context *cli.Context) (*containerd.Client, gocontext.Context, gocontext.CancelFunc, error) {
client, err := containerd.New(context.GlobalString("address"))
if err != nil {
return nil, nil, nil, err
}
ctx, cancel := appContext(context)
return client, ctx, cancel, nil
}
func passwordPrompt() (string, error) {