From e5ddf34e648c6bf431e062c90b067f5eb8a3beb0 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 26 Feb 2018 12:21:26 -0600 Subject: 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 Closes: #405 Approved by: baude --- libpod/runtime_img.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libpod') 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 } -- cgit v1.2.3-54-g00ecf