From aa247f950c73e164486ac5f9f0c0d0d1b418de6a Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 24 Apr 2018 17:32:07 -0400 Subject: Remove more Errorf in favor of Wrapf Signed-off-by: Matthew Heon Closes: #668 Approved by: rhatdan --- libpod/image/pull.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libpod/image/pull.go') diff --git a/libpod/image/pull.go b/libpod/image/pull.go index 74a773987..cdecd4e0e 100644 --- a/libpod/image/pull.go +++ b/libpod/image/pull.go @@ -61,7 +61,7 @@ func (ir *Runtime) getPullStruct(srcRef types.ImageReference, destName string) ( } destRef, err := is.Transport.ParseStoreReference(ir.store, reference) if err != nil { - return nil, errors.Errorf("error parsing dest reference name: %v", err) + return nil, errors.Wrapf(err, "error parsing dest reference name") } return &pullStruct{ image: destName, @@ -85,7 +85,7 @@ func (ir *Runtime) getPullListFromRef(ctx context.Context, srcRef types.ImageRef manifest, err := tarSource.LoadTarManifest() if err != nil { - return nil, errors.Errorf("error retrieving manifest.json: %v", err) + return nil, errors.Wrapf(err, "error retrieving manifest.json") } // to pull the first image stored in the tar file if len(manifest) == 0 { @@ -224,7 +224,7 @@ func (i *Image) createNamesToPull() ([]*pullStruct, error) { if decomposedImage.hasRegistry { srcRef, err := alltransports.ParseImageName(decomposedImage.assembleWithTransport()) if err != nil { - return nil, errors.Errorf("unable to parse '%s'", i.InputName) + return nil, errors.Wrapf(err, "unable to parse '%s'", i.InputName) } ps := pullStruct{ image: i.InputName, @@ -246,7 +246,7 @@ func (i *Image) createNamesToPull() ([]*pullStruct, error) { decomposedImage.registry = registry srcRef, err := alltransports.ParseImageName(decomposedImage.assembleWithTransport()) if err != nil { - return nil, errors.Errorf("unable to parse '%s'", i.InputName) + return nil, errors.Wrapf(err, "unable to parse '%s'", i.InputName) } ps := pullStruct{ image: decomposedImage.assemble(), @@ -259,7 +259,7 @@ func (i *Image) createNamesToPull() ([]*pullStruct, error) { for _, pStruct := range pullNames { destRef, err := is.Transport.ParseStoreReference(i.imageruntime.store, pStruct.image) if err != nil { - return nil, errors.Errorf("error parsing dest reference name: %v", err) + return nil, errors.Wrapf(err, "error parsing dest reference name") } pStruct.dstRef = destRef } -- cgit v1.2.3-54-g00ecf