File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ func ParseDockerRef(ref string) (Named, error) {
9090// needs to be already validated before.
9191func splitDockerDomain (name string ) (domain , remainder string ) {
9292 i := strings .IndexRune (name , '/' )
93- if i == - 1 || (! strings .ContainsAny (name [:i ], ".:" ) && name [:i ] != "localhost" ) {
93+ if i == - 1 || (! strings .ContainsAny (name [:i ], ".:" ) && name [:i ] != "localhost" && strings . ToLower ( name [: i ]) == name [: i ] ) {
9494 domain , remainder = defaultDomain , name
9595 } else {
9696 domain , remainder = name [:i ], name [i + 1 :]
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ func TestValidateReferenceName(t *testing.T) {
2828 // when specified with a hostname, it removes the ambiguity from about
2929 // whether the value is an identifier or repository name
3030 "docker.io/1a3f5e7d9c1b3a5f7e9d1c3b5a7f9e1d3c5b7a9f1e3d5d7c9b1a3f5e7d9c1b3a" ,
31+ "Docker/docker" ,
32+ "DOCKER/docker" ,
3133 }
3234 invalidRepoNames := []string {
3335 "https://github.com/docker/docker" ,
@@ -229,6 +231,20 @@ func TestParseRepositoryInfo(t *testing.T) {
229231 AmbiguousName : "" ,
230232 Domain : "docker.io" ,
231233 },
234+ {
235+ RemoteName : "bar" ,
236+ FamiliarName : "Foo/bar" ,
237+ FullName : "Foo/bar" ,
238+ AmbiguousName : "" ,
239+ Domain : "Foo" ,
240+ },
241+ {
242+ RemoteName : "bar" ,
243+ FamiliarName : "FOO/bar" ,
244+ FullName : "FOO/bar" ,
245+ AmbiguousName : "" ,
246+ Domain : "FOO" ,
247+ },
232248 }
233249
234250 for _ , tcase := range tcases {
You can’t perform that action at this time.
0 commit comments