aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2020-02-07 02:37:36 +0100
committerMiloslav Trmač <mitr@redhat.com>2020-02-07 23:36:01 +0100
commitdafd212870585313442de0342c5455ef42099d5e (patch)
tree45e2805fd4e1cfe54a1b7033fefffafddf1f9ca1 /libpod
parent5b5bacbd95fb4a87bdb294504621dba766aed626 (diff)
downloadpodman-dafd212870585313442de0342c5455ef42099d5e.tar.gz
podman-dafd212870585313442de0342c5455ef42099d5e.tar.bz2
podman-dafd212870585313442de0342c5455ef42099d5e.zip
Modify Runtime.getImage to return a storage.Image
... because both callers only care about that aspect of the return value. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/image/image.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go
index ddde1c8da..43fd52a1a 100644
--- a/libpod/image/image.go
+++ b/libpod/image/image.go
@@ -218,7 +218,7 @@ func (i *Image) reloadImage() error {
if err != nil {
return errors.Wrapf(err, "unable to reload image")
}
- i.image = newImage.image
+ i.image = newImage
return nil
}
@@ -245,7 +245,7 @@ func (ir *Runtime) getLocalImage(inputName string) (string, *storage.Image, erro
img, err := ir.getImage(stripSha256(inputName))
if err == nil {
- return inputName, img.image, err
+ return inputName, img, err
}
// container-storage wasn't able to find it in its current form
@@ -269,7 +269,7 @@ func (ir *Runtime) getLocalImage(inputName string) (string, *storage.Image, erro
}
img, err = ir.getImage(ref.String())
if err == nil {
- return inputName, img.image, err
+ return inputName, img, err
}
// grab all the local images
@@ -444,7 +444,7 @@ func (i *Image) Remove(ctx context.Context, force bool) error {
// getImage retrieves an image matching the given name or hash from system
// storage
// If no matching image can be found, an error is returned
-func (ir *Runtime) getImage(image string) (*Image, error) {
+func (ir *Runtime) getImage(image string) (*storage.Image, error) {
var img *storage.Image
ref, err := is.Transport.ParseStoreReference(ir.store, image)
if err == nil {
@@ -460,8 +460,7 @@ func (ir *Runtime) getImage(image string) (*Image, error) {
}
img = img2
}
- newImage := ir.newFromStorage(img)
- return newImage, nil
+ return img, nil
}
// GetImages retrieves all images present in storage