summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Grunert <sgrunert@suse.com>2020-02-04 14:21:59 +0100
committerSascha Grunert <sgrunert@suse.com>2020-02-04 14:21:59 +0100
commitb8a2818e70e402118f2a85c7bcea66a74f16b41d (patch)
tree8265437c1f85295370446de1c7381215526676d7
parentc4f6d5615a34ea67b1335a2a446bd09789d98015 (diff)
downloadpodman-b8a2818e70e402118f2a85c7bcea66a74f16b41d.tar.gz
podman-b8a2818e70e402118f2a85c7bcea66a74f16b41d.tar.bz2
podman-b8a2818e70e402118f2a85c7bcea66a74f16b41d.zip
Wrap error for failing ImageSize calls
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
-rw-r--r--libpod/image/image.go5
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