summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-11-05 15:25:48 +0100
committerGitHub <noreply@github.com>2019-11-05 15:25:48 +0100
commita904e21cf0213185fd115683dc2adc4baeff922a (patch)
tree53912b8f764898e0beff90b3f5fd93a5ed988020 /libpod
parent08c5c546dcb0056d6a4f11a39ac3eba8cd7429fe (diff)
parent274fe57d3ed691adddb2269c28ac88f9b1315a43 (diff)
downloadpodman-a904e21cf0213185fd115683dc2adc4baeff922a.tar.gz
podman-a904e21cf0213185fd115683dc2adc4baeff922a.tar.bz2
podman-a904e21cf0213185fd115683dc2adc4baeff922a.zip
Merge pull request #4449 from vrothberg/fix-4434
pulling unqualified reference: make sure it's a docker reference
Diffstat (limited to 'libpod')
-rw-r--r--libpod/image/pull.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/image/pull.go b/libpod/image/pull.go
index 7f5dc33b9..99c11e3ff 100644
--- a/libpod/image/pull.go
+++ b/libpod/image/pull.go
@@ -230,7 +230,12 @@ func (ir *Runtime) pullImageFromHeuristicSource(ctx context.Context, inputName s
sc.BlobInfoCacheDir = filepath.Join(ir.store.GraphRoot(), "cache")
srcRef, err := alltransports.ParseImageName(inputName)
if err != nil {
- // could be trying to pull from registry with short name
+ // We might be pulling with an unqualified image reference in which case
+ // we need to make sure that we're not using any other transport.
+ srcTransport := alltransports.TransportFromImageName(inputName)
+ if srcTransport != nil && srcTransport.Name() != DockerTransport {
+ return nil, err
+ }
goal, err = ir.pullGoalFromPossiblyUnqualifiedName(inputName)
if err != nil {
return nil, errors.Wrap(err, "error getting default registries to try")
@@ -347,6 +352,7 @@ func (ir *Runtime) pullGoalFromPossiblyUnqualifiedName(inputName string) (*pullG
if err != nil {
return nil, err
}
+
if decomposedImage.hasRegistry {
srcRef, err := docker.ParseReference("//" + inputName)
if err != nil {