Pass in context to lease done function in client

Allows the client to choose the context to finish the lease.
This allows the client to switch contexts when the main context
used to the create the lease may have been cancelled.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2018-03-22 14:09:24 -07:00
parent 9304193b8c
commit 43d0a5cb60
10 changed files with 21 additions and 19 deletions

View File

@@ -199,7 +199,7 @@ func (c *Client) NewContainer(ctx context.Context, id string, opts ...NewContain
if err != nil {
return nil, err
}
defer done()
defer done(ctx)
container := containers.Container{
ID: id,
@@ -284,7 +284,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (Image
if err != nil {
return nil, err
}
defer done()
defer done(ctx)
name, desc, err := pullCtx.Resolver.Resolve(ctx, ref)
if err != nil {
@@ -561,7 +561,7 @@ func (c *Client) Import(ctx context.Context, importer images.Importer, reader io
if err != nil {
return nil, err
}
defer done()
defer done(ctx)
imgrecs, err := importer.Import(ctx, c.ContentStore(), reader)
if err != nil {