Merge pull request #405 from nalind/pull-tag

Preserve the tag of the pulled image's name
This commit is contained in:
Antonio Murdaca 2017-03-24 19:16:23 +01:00 committed by GitHub
commit a7492f4a2f

View file

@ -2,6 +2,7 @@ package storage
import ( import (
"github.com/containers/image/copy" "github.com/containers/image/copy"
"github.com/containers/image/docker/reference"
"github.com/containers/image/signature" "github.com/containers/image/signature"
istorage "github.com/containers/image/storage" istorage "github.com/containers/image/storage"
"github.com/containers/image/transports/alltransports" "github.com/containers/image/transports/alltransports"
@ -132,6 +133,9 @@ func (svc *imageService) PullImage(systemContext *types.SystemContext, imageName
dest := imageName dest := imageName
if srcRef.DockerReference() != nil { if srcRef.DockerReference() != nil {
dest = srcRef.DockerReference().Name() dest = srcRef.DockerReference().Name()
if tagged, ok := srcRef.DockerReference().(reference.NamedTagged); ok {
dest = dest + ":" + tagged.Tag()
}
} }
destRef, err := istorage.Transport.ParseStoreReference(svc.store, dest) destRef, err := istorage.Transport.ParseStoreReference(svc.store, dest)
if err != nil { if err != nil {