diff options
author | umohnani8 <umohnani@redhat.com> | 2018-04-18 16:48:35 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-19 14:08:47 +0000 |
commit | 27107fdac1d75f97caab47cd13efb1d9900cf350 (patch) | |
tree | f5edafbb52505829b15e19ea6a9e66f4440e862b /libpod/buildah/buildah.go | |
parent | 6a9dbf3305e93e5e1c3bff09402a9b801c935fbd (diff) | |
download | podman-27107fdac1d75f97caab47cd13efb1d9900cf350.tar.gz podman-27107fdac1d75f97caab47cd13efb1d9900cf350.tar.bz2 podman-27107fdac1d75f97caab47cd13efb1d9900cf350.zip |
Vendor in latest containers/image and contaners/storage
Made necessary changes to functions to include contex.Context wherever needed
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #640
Approved by: baude
Diffstat (limited to 'libpod/buildah/buildah.go')
-rw-r--r-- | libpod/buildah/buildah.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libpod/buildah/buildah.go b/libpod/buildah/buildah.go index b560f99a1..8f4b95ac8 100644 --- a/libpod/buildah/buildah.go +++ b/libpod/buildah/buildah.go @@ -1,6 +1,7 @@ package buildah import ( + "context" "encoding/json" "path/filepath" @@ -128,11 +129,11 @@ type ImportOptions struct { // ImportBuilder creates a new build configuration using an already-present // container. -func ImportBuilder(store storage.Store, options ImportOptions) (*Builder, error) { - return importBuilder(store, options) +func ImportBuilder(ctx context.Context, store storage.Store, options ImportOptions) (*Builder, error) { + return importBuilder(ctx, store, options) } -func importBuilder(store storage.Store, options ImportOptions) (*Builder, error) { +func importBuilder(ctx context.Context, store storage.Store, options ImportOptions) (*Builder, error) { if options.Container == "" { return nil, errors.Errorf("container name must be specified") } @@ -144,7 +145,7 @@ func importBuilder(store storage.Store, options ImportOptions) (*Builder, error) systemContext := getSystemContext(&types.SystemContext{}, options.SignaturePolicyPath) - builder, err := importBuilderDataFromImage(store, systemContext, c.ImageID, options.Container, c.ID) + builder, err := importBuilderDataFromImage(ctx, store, systemContext, c.ImageID, options.Container, c.ID) if err != nil { return nil, err } @@ -168,7 +169,7 @@ func importBuilder(store storage.Store, options ImportOptions) (*Builder, error) return builder, nil } -func importBuilderDataFromImage(store storage.Store, systemContext *types.SystemContext, imageID, containerName, containerID string) (*Builder, error) { +func importBuilderDataFromImage(ctx context.Context, store storage.Store, systemContext *types.SystemContext, imageID, containerName, containerID string) (*Builder, error) { manifest := []byte{} config := []byte{} imageName := "" @@ -178,16 +179,16 @@ func importBuilderDataFromImage(store storage.Store, systemContext *types.System if err != nil { return nil, errors.Wrapf(err, "no such image %q", imageID) } - src, err2 := ref.NewImage(systemContext) + src, err2 := ref.NewImage(ctx, systemContext) if err2 != nil { return nil, errors.Wrapf(err2, "error instantiating image") } defer src.Close() - config, err = src.ConfigBlob() + config, err = src.ConfigBlob(ctx) if err != nil { return nil, errors.Wrapf(err, "error reading image configuration") } - manifest, _, err = src.Manifest() + manifest, _, err = src.Manifest(ctx) if err != nil { return nil, errors.Wrapf(err, "error reading image manifest") } |