Allow uppercase characters in image reference hostname
This PR makes restores the pre-Docker 1.10 behavior of allowing uppercase characters in registry hostnames. Note that this only applies to hostnames, not remote image names. Previous versions also prohibited uppercase letters after the hostname, but Docker 1.10 extended this to the hostname itself. - Vendor updated docker/distribution. - Add a check to "normalize" that rejects remote names with uppercase letters. - Add test cases to TestTagValidPrefixedRepo and TestTagInvalidUnprefixedRepo Fixes: #20056 Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com> Upstream-commit: e2afab9c4a8be800dffee9b60b2197350987543c Component: engine
This commit is contained in:
@ -31,7 +31,7 @@ func (s *DockerSuite) TestTagUnprefixedRepoByID(c *check.C) {
|
||||
|
||||
// ensure we don't allow the use of invalid repository names; these tag operations should fail
|
||||
func (s *DockerSuite) TestTagInvalidUnprefixedRepo(c *check.C) {
|
||||
invalidRepos := []string{"fo$z$", "Foo@3cc", "Foo$3", "Foo*3", "Fo^3", "Foo!3", "F)xcz(", "fo%asd"}
|
||||
invalidRepos := []string{"fo$z$", "Foo@3cc", "Foo$3", "Foo*3", "Fo^3", "Foo!3", "F)xcz(", "fo%asd", "FOO/bar"}
|
||||
|
||||
for _, repo := range invalidRepos {
|
||||
out, _, err := dockerCmdWithError("tag", "busybox", repo)
|
||||
@ -61,7 +61,7 @@ func (s *DockerSuite) TestTagValidPrefixedRepo(c *check.C) {
|
||||
}
|
||||
}
|
||||
|
||||
validRepos := []string{"fooo/bar", "fooaa/test", "foooo:t"}
|
||||
validRepos := []string{"fooo/bar", "fooaa/test", "foooo:t", "HOSTNAME.DOMAIN.COM:443/foo/bar"}
|
||||
|
||||
for _, repo := range validRepos {
|
||||
_, _, err := dockerCmdWithError("tag", "busybox:latest", repo)
|
||||
|
||||
Reference in New Issue
Block a user