Strip transport from image name when looking for local image

When a user pulls an image using a transport, like docker-daemon, we try to lookup
the new image in storage by the input name after the pull.  Because the input name
has a transport (different than local storage), that lookup would fail.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #644
Approved by: rhatdan
This commit is contained in:
baude
2018-04-19 08:19:14 -05:00
committed by Atomic Bot
parent 5973841f52
commit cc03743c0f

View File

@ -183,6 +183,12 @@ func (i *Image) getLocalImage() (*storage.Image, error) {
if i.InputName == "" {
return nil, errors.Errorf("input name is blank")
}
// Check if the input name has a transport and if so strip it
dest, err := alltransports.ParseImageName(i.InputName)
if err == nil && dest.DockerReference() != nil {
i.InputName = dest.DockerReference().String()
}
var taggedName string
img, err := i.imageruntime.getImage(stripSha256(i.InputName))
if err == nil {