From 27107fdac1d75f97caab47cd13efb1d9900cf350 Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Wed, 18 Apr 2018 16:48:35 -0400 Subject: Vendor in latest containers/image and contaners/storage Made necessary changes to functions to include contex.Context wherever needed Signed-off-by: umohnani8 Closes: #640 Approved by: baude --- libpod/buildah/commit.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libpod/buildah/commit.go') diff --git a/libpod/buildah/commit.go b/libpod/buildah/commit.go index b862031d2..537f9edbf 100644 --- a/libpod/buildah/commit.go +++ b/libpod/buildah/commit.go @@ -1,6 +1,7 @@ package buildah import ( + "context" "fmt" "io" "time" @@ -74,7 +75,7 @@ type PushOptions struct { // Commit writes the contents of the container, along with its updated // configuration, to a new image in the specified location, and if we know how, // add any additional tags that were specified. -func (b *Builder) Commit(dest types.ImageReference, options CommitOptions) error { +func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options CommitOptions) error { policy, err := signature.DefaultPolicy(getSystemContext(options.SystemContext, options.SignaturePolicyPath)) if err != nil { return errors.Wrapf(err, "error obtaining default signature policy") @@ -96,7 +97,7 @@ func (b *Builder) Commit(dest types.ImageReference, options CommitOptions) error return errors.Wrapf(err, "error computing layer digests and building metadata") } // "Copy" our image to where it needs to be. - err = cp.Image(policyContext, dest, src, getCopyOptions(options.ReportWriter, nil, options.SystemContext, "")) + err = cp.Image(ctx, policyContext, dest, src, getCopyOptions(options.ReportWriter, nil, options.SystemContext, "")) if err != nil { return errors.Wrapf(err, "error copying layers and metadata") } @@ -120,7 +121,7 @@ func (b *Builder) Commit(dest types.ImageReference, options CommitOptions) error } // Push copies the contents of the image to a new location. -func Push(image string, dest types.ImageReference, options PushOptions) error { +func Push(ctx context.Context, image string, dest types.ImageReference, options PushOptions) error { systemContext := getSystemContext(options.SystemContext, options.SignaturePolicyPath) policy, err := signature.DefaultPolicy(systemContext) if err != nil { @@ -136,7 +137,7 @@ func Push(image string, dest types.ImageReference, options PushOptions) error { return errors.Wrapf(err, "error parsing reference to image %q", image) } // Copy everything. - err = cp.Image(policyContext, dest, src, getCopyOptions(options.ReportWriter, nil, options.SystemContext, options.ManifestType)) + err = cp.Image(ctx, policyContext, dest, src, getCopyOptions(options.ReportWriter, nil, options.SystemContext, options.ManifestType)) if err != nil { return errors.Wrapf(err, "error copying layers and metadata") } -- cgit v1.2.3-54-g00ecf