diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-02-04 07:12:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 07:12:56 -0800 |
commit | 537352cc3ee60373b41481a7f48e65b1978ea5f7 (patch) | |
tree | a1b3b06a2d23f3ad7ecc900e9398f2e220090cc5 /libpod/image | |
parent | 28eb296653f78f462c07e3fe6b156bc093ff44c6 (diff) | |
parent | b8a2818e70e402118f2a85c7bcea66a74f16b41d (diff) | |
download | podman-537352cc3ee60373b41481a7f48e65b1978ea5f7.tar.gz podman-537352cc3ee60373b41481a7f48e65b1978ea5f7.tar.bz2 podman-537352cc3ee60373b41481a7f48e65b1978ea5f7.zip |
Merge pull request #5079 from openSUSE/error-image-size
Wrap error for failing ImageSize calls
Diffstat (limited to 'libpod/image')
-rw-r--r-- | libpod/image/image.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index 355249b12..ba1080a71 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -709,11 +709,12 @@ func (i *Image) Size(ctx context.Context) (*uint64, error) { } i.image = localImage } - if sum, err := i.imageruntime.store.ImageSize(i.ID()); err == nil && sum >= 0 { + sum, err := i.imageruntime.store.ImageSize(i.ID()) + if err == nil && sum >= 0 { usum := uint64(sum) return &usum, nil } - return nil, errors.Errorf("unable to determine size") + return nil, errors.Wrap(err, "unable to determine size") } // toImageRef returns an Image Reference type from an image |