Merge pull request #3505 from crosbymichael/remoteopts-unpack

Add UnpackOpts to RemoteContext
This commit is contained in:
Michael Crosby 2019-08-08 13:20:34 -04:00 committed by GitHub
commit 23faecfb66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -298,6 +298,9 @@ type RemoteContext struct {
// afterwards. Unpacking is required to run an image. // afterwards. Unpacking is required to run an image.
Unpack bool Unpack bool
// UnpackOpts handles options to the unpack call.
UnpackOpts []UnpackOpt
// Snapshotter used for unpacking // Snapshotter used for unpacking
Snapshotter string Snapshotter string

View File

@ -69,7 +69,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpt) (Image
i := NewImageWithPlatform(c, img, pullCtx.PlatformMatcher) i := NewImageWithPlatform(c, img, pullCtx.PlatformMatcher)
if pullCtx.Unpack { if pullCtx.Unpack {
if err := i.Unpack(ctx, pullCtx.Snapshotter); err != nil { if err := i.Unpack(ctx, pullCtx.Snapshotter, pullCtx.UnpackOpts...); err != nil {
return nil, errors.Wrapf(err, "failed to unpack image on snapshotter %s", pullCtx.Snapshotter) return nil, errors.Wrapf(err, "failed to unpack image on snapshotter %s", pullCtx.Snapshotter)
} }
} }