mirror of https://github.com/docker/docs.git
Update distribution package
Pick up name regexp change in distribution to allow matching of hostnames as a valid component of a repository. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
6d9a84bcd0
commit
b5b0da5fec
|
@ -36,7 +36,7 @@ clone git github.com/hashicorp/consul v0.5.2
|
||||||
clone git github.com/boltdb/bolt v1.0
|
clone git github.com/boltdb/bolt v1.0
|
||||||
|
|
||||||
# get graph and distribution packages
|
# get graph and distribution packages
|
||||||
clone git github.com/docker/distribution ec87e9b6971d831f0eff752ddb54fb64693e51cd # docker/1.8 branch
|
clone git github.com/docker/distribution 20c4b7a1805a52753dfd593ee1cc35558722a0ce # docker/1.9 branch
|
||||||
clone git github.com/vbatts/tar-split v0.9.10
|
clone git github.com/vbatts/tar-split v0.9.10
|
||||||
|
|
||||||
clone git github.com/docker/notary ac05822d7d71ef077df3fc24f506672282a1feea
|
clone git github.com/docker/notary ac05822d7d71ef077df3fc24f506672282a1feea
|
||||||
|
|
|
@ -767,6 +767,9 @@ func TestValidRemoteName(t *testing.T) {
|
||||||
// Allow embedded hyphens.
|
// Allow embedded hyphens.
|
||||||
"docker-rules/docker",
|
"docker-rules/docker",
|
||||||
|
|
||||||
|
// Allow multiple hyphens as well.
|
||||||
|
"docker---rules/docker",
|
||||||
|
|
||||||
//Username doc and image name docker being tested.
|
//Username doc and image name docker being tested.
|
||||||
"doc/docker",
|
"doc/docker",
|
||||||
|
|
||||||
|
@ -800,8 +803,11 @@ func TestValidRemoteName(t *testing.T) {
|
||||||
|
|
||||||
"_docker/_docker",
|
"_docker/_docker",
|
||||||
|
|
||||||
// Disallow consecutive hyphens.
|
// Disallow consecutive underscores and periods.
|
||||||
"dock--er/docker",
|
"dock__er/docker",
|
||||||
|
"dock..er/docker",
|
||||||
|
"dock_.er/docker",
|
||||||
|
"dock-.er/docker",
|
||||||
|
|
||||||
// No repository.
|
// No repository.
|
||||||
"docker/",
|
"docker/",
|
||||||
|
|
|
@ -15,10 +15,23 @@ const (
|
||||||
RepositoryNameTotalLengthMax = 255
|
RepositoryNameTotalLengthMax = 255
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// domainLabelRegexp represents the following RFC-2396 BNF construct:
|
||||||
|
// domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
|
||||||
|
var domainLabelRegexp = regexp.MustCompile(`[a-z0-9](?:-*[a-z0-9])*`)
|
||||||
|
|
||||||
// RepositoryNameComponentRegexp restricts registry path component names to
|
// RepositoryNameComponentRegexp restricts registry path component names to
|
||||||
// start with at least one letter or number, with following parts able to
|
// the allow valid hostnames according to: https://www.ietf.org/rfc/rfc2396.txt
|
||||||
// be separated by one period, dash or underscore.
|
// with the following differences:
|
||||||
var RepositoryNameComponentRegexp = regexp.MustCompile(`[a-z0-9]+(?:[._-][a-z0-9]+)*`)
|
// 1) It DOES NOT allow for fully-qualified domain names, which include a
|
||||||
|
// trailing '.', e.g. "google.com."
|
||||||
|
// 2) It DOES NOT restrict 'top-level' domain labels to start with just alpha
|
||||||
|
// characters.
|
||||||
|
// 3) It DOES allow for underscores to appear in the same situations as dots.
|
||||||
|
//
|
||||||
|
// RFC-2396 uses the BNF construct:
|
||||||
|
// hostname = *( domainlabel "." ) toplabel [ "." ]
|
||||||
|
var RepositoryNameComponentRegexp = regexp.MustCompile(
|
||||||
|
domainLabelRegexp.String() + `(?:[._]` + domainLabelRegexp.String() + `)*`)
|
||||||
|
|
||||||
// RepositoryNameComponentAnchoredRegexp is the version of
|
// RepositoryNameComponentAnchoredRegexp is the version of
|
||||||
// RepositoryNameComponentRegexp which must completely match the content
|
// RepositoryNameComponentRegexp which must completely match the content
|
||||||
|
|
Loading…
Reference in New Issue