summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-02-26 12:21:26 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-26 22:30:44 +0000
commite5ddf34e648c6bf431e062c90b067f5eb8a3beb0 (patch)
tree36fe79cf6de27c851166b09d7c7d252b445dc9ac /libpod
parent9f7643c364dece892a7f89484142e69c8e8185f8 (diff)
downloadpodman-e5ddf34e648c6bf431e062c90b067f5eb8a3beb0.tar.gz
podman-e5ddf34e648c6bf431e062c90b067f5eb8a3beb0.tar.bz2
podman-e5ddf34e648c6bf431e062c90b067f5eb8a3beb0.zip
podman load dont panic when no repotags
When performing a podman load, if there were no repotags in the image, podman would panic. In the case that the incoming image does have repotags, it should be imported as a none:none image so it can still be used by the user. Resolves issue #403 Signed-off-by: baude <bbaude@redhat.com> Closes: #405 Approved by: baude
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_img.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index cc6275494..8a21785bf 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -624,7 +624,17 @@ func (r *Runtime) getPullListFromRef(srcRef types.ImageReference, imgName string
}
pullStructs = append(pullStructs, pullInfo)
} else {
- pullInfo, err := r.getPullStruct(srcRef, manifest[0].RepoTags[0])
+ var dest string
+ if len(manifest[0].RepoTags) > 0 {
+ dest = manifest[0].RepoTags[0]
+ } else {
+ // If the input image has no repotags, we need to feed it a dest anyways
+ dest, err = getImageDigest(srcRef, sc)
+ if err != nil {
+ return nil, err
+ }
+ }
+ pullInfo, err := r.getPullStruct(srcRef, dest)
if err != nil {
return nil, err
}