summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-11-05 12:16:43 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-11-05 12:16:43 +0100
commit274fe57d3ed691adddb2269c28ac88f9b1315a43 (patch)
tree84926e6e991d2110ec9d3c249b222e94c85891af
parentcc19b09b44634fe689c2a8b2e9b0102adf47c419 (diff)
downloadpodman-274fe57d3ed691adddb2269c28ac88f9b1315a43.tar.gz
podman-274fe57d3ed691adddb2269c28ac88f9b1315a43.tar.bz2
podman-274fe57d3ed691adddb2269c28ac88f9b1315a43.zip
pulling unqualified reference: make sure it's a docker reference
When pulling an unqualified reference (e.g., `fedora`) make sure that the reference is not using a non-docker transport to avoid iterating over the search registries and trying to pull from them. Fixes: #4434 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
-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 {