Skip to content

Commit caa9083

Browse files
committed
ParseDockerImageReference use docker/distribution reference parser
We can't remove ParseDockerImageReference and just use docker/distribution/reference to parse DockerImageReference because we have to support few special cases related to docker.io. Keeping it in mind, we can reimplement ParseDockerImageReference to use new parser. In addition we got new limits on the length of the DockerImageReference. So, after refactoring our restrictions are pretty the same as in docker/distribution. Signed-off-by: Gladkov Alexey <[email protected]>
1 parent 606716e commit caa9083

27 files changed

+747
-705
lines changed

pkg/api/graph/test/prereq-image-not-present.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ items:
9090
sourceStrategy:
9191
from:
9292
kind: ImageStreamImage
93-
name: ruby-20-centos7@603bfa418
93+
name: ruby-20-centos7@sha256:603bfa418e1ff0a486f3d795a8b69a2f8f5eed488fbf5c286bffd8ab77b8e7a5
9494
namespace: openshift
9595
type: Docker
9696
triggers:

pkg/api/graph/test/prereq-image-present-notag.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ items:
160160
sourceStrategy:
161161
from:
162162
kind: ImageStreamImage
163-
name: ruby-20-centos7@603bfa418
163+
name: ruby-20-centos7@sha256:603bfa418e1ff0a486f3d795a8b69a2f8f5eed488fbf5c286bffd8ab77b8e7a5
164164
namespace: openshift
165165
type: Docker
166166
triggers:

pkg/api/graph/test/prereq-image-present-with-sched.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ items:
9090
sourceStrategy:
9191
from:
9292
kind: ImageStreamImage
93-
name: ruby-20-centos7@603bfa418
93+
name: ruby-20-centos7@sha256:603bfa418e1ff0a486f3d795a8b69a2f8f5eed488fbf5c286bffd8ab77b8e7a5
9494
namespace: example
9595
type: Docker
9696
triggers:

pkg/api/graph/test/prereq-image-present.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ items:
9090
sourceStrategy:
9191
from:
9292
kind: ImageStreamImage
93-
name: ruby-20-centos7@603bfa418
93+
name: ruby-20-centos7@sha256:603bfa418e1ff0a486f3d795a8b69a2f8f5eed488fbf5c286bffd8ab77b8e7a5
9494
namespace: openshift
9595
type: Docker
9696
triggers:

pkg/build/controller/strategy/custom_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func mockCustomBuild(forcePull, emptySource bool) *buildapi.Build {
207207
Output: buildapi.BuildOutput{
208208
To: &kapi.ObjectReference{
209209
Kind: "DockerImage",
210-
Name: "docker-registry/repository/customBuild",
210+
Name: "docker-registry.io/repository/custombuild",
211211
},
212212
PushSecret: &kapi.LocalObjectReference{Name: "foo"},
213213
},

pkg/build/generator/generator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
type FakeDockerCfg map[string]map[string]string
2525

2626
const (
27-
originalImage = "originalImage"
27+
originalImage = "originalimage"
2828
newImage = originalImage + ":" + newTag
2929

3030
tagName = "test"

pkg/cmd/admin/migrate/images/imagerefs_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ func TestImageReferenceMappingsMapReference(t *testing.T) {
2929

3030
"mysql@sha256:b2f400f4a5e003b0543decf61a0a010939f3fba07bafa226f11ed7b5f1e81237": "index.docker.io/mysql@sha256:b2f400f4a5e003b0543decf61a0a010939f3fba07bafa226f11ed7b5f1e81237",
3131

32-
"docker.io/mysql": "index.docker.io/library/mysql",
33-
"docker.io/mysql:latest": "index.docker.io/library/mysql:latest",
32+
"docker.io/mysql": "index.docker.io/mysql",
33+
"docker.io/mysql:latest": "index.docker.io/mysql:latest",
3434
"docker.io/default/mysql:latest": "index.docker.io/default/mysql:latest",
3535

36-
"docker.io/mysql@sha256:b2f400f4a5e003b0543decf61a0a010939f3fba07bafa226f11ed7b5f1e81237": "index.docker.io/library/mysql@sha256:b2f400f4a5e003b0543decf61a0a010939f3fba07bafa226f11ed7b5f1e81237",
36+
"docker.io/mysql@sha256:b2f400f4a5e003b0543decf61a0a010939f3fba07bafa226f11ed7b5f1e81237": "index.docker.io/mysql@sha256:b2f400f4a5e003b0543decf61a0a010939f3fba07bafa226f11ed7b5f1e81237",
3737
},
3838
},
3939
{
@@ -54,9 +54,6 @@ func TestImageReferenceMappingsMapReference(t *testing.T) {
5454
"myregistry.com/test/other:latest": "myregistry.com/other/test:latest",
5555

5656
"test/other/b:latest": "test/other/b:latest",
57-
58-
// TODO: this is possibly wrong with V2 and latest daemon
59-
"b/test/other:latest": "b/other/test:latest",
6057
},
6158
},
6259
}

0 commit comments

Comments
 (0)