summaryrefslogtreecommitdiff
path: root/libpod/runtime_img.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-03 14:00:45 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-04 17:39:42 +0000
commit04593b1591fe78b5e8689ce144431a3f07c19fbe (patch)
treed4ec6559baa4145518a011aaf56e678a82c2ec96 /libpod/runtime_img.go
parent26c83de94392aa0c1207bea358e3ea22fc047222 (diff)
downloadpodman-04593b1591fe78b5e8689ce144431a3f07c19fbe.tar.gz
podman-04593b1591fe78b5e8689ce144431a3f07c19fbe.tar.bz2
podman-04593b1591fe78b5e8689ce144431a3f07c19fbe.zip
Run by shortname
While pulling by shortname (fedora-minimal) worked, running a container by the short name did not due to a logic error. Signed-off-by: baude <bbaude@redhat.com> Closes: #182 Approved by: rhatdan
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r--libpod/runtime_img.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 53211ff54..6178d5372 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -328,12 +328,12 @@ func getTags(nameInput string) (reference.NamedTagged, bool, error) {
// It will return an empty string and error if not found.
func (k *Image) GetLocalImageName() (string, error) {
_, err := k.runtime.GetImage(k.Name)
- if err != nil {
- return "", errors.Wrapf(err, "unable to obtain local image")
+ if err == nil {
+ return k.Name, nil
}
localImages, err := k.runtime.GetImages(&ImageFilterParams{})
if err != nil {
- return "", errors.Wrapf(err, "unable to obtain local image")
+ return "", errors.Wrapf(err, "unable to find local images")
}
_, isTagged, err := getTags(k.Name)
if err != nil {
@@ -370,8 +370,7 @@ func (k *Image) GetLocalImageName() (string, error) {
}
}
}
- fqname, _ := k.GetFQName()
- return fqname, nil
+ return "", errors.Wrapf(storage.ErrImageUnknown, "unable to find image locally")
}
// HasLatest determines if we have the latest image local