Merge pull request #4449 from vrothberg/fix-4434

pulling unqualified reference: make sure it's a docker reference
This commit is contained in:
OpenShift Merge Robot 2019-11-05 15:25:48 +01:00 committed by GitHub
commit a904e21cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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 {