Skip to content

Conversation

shishir-a412ed
Copy link
Contributor

This change relaxes the restriction on namespace (username) from 30 to 255 characters.

Issue related to this: #10392

Shishir

@@ -223,7 +223,7 @@ func validateRemoteName(remoteName string) error {
if !validNamespaceChars.MatchString(namespace) {
return fmt.Errorf("Invalid namespace name (%s). Only [a-z0-9-_] are allowed.", namespace)
}
if len(namespace) < 4 || len(namespace) > 30 {
if len(namespace) < 4 || len(namespace) > 256 {
return fmt.Errorf("Invalid namespace name (%s). Cannot be fewer than 4 or more than 30 characters.", namespace)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to update the error text

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ncdc for the catch !
I have updated the code.

@shishir-a412ed shishir-a412ed force-pushed the restriction_username_length branch from f3870dd to a8cc254 Compare March 2, 2015 22:09
@thaJeztah
Copy link
Member

Note to reviewers; it looks like the limit in registry v2 has not yet been updated, see #10392 (comment)

@@ -223,8 +223,8 @@ func validateRemoteName(remoteName string) error {
if !validNamespaceChars.MatchString(namespace) {
return fmt.Errorf("Invalid namespace name (%s). Only [a-z0-9-_] are allowed.", namespace)
}
if len(namespace) < 4 || len(namespace) > 30 {
return fmt.Errorf("Invalid namespace name (%s). Cannot be fewer than 4 or more than 30 characters.", namespace)
if len(namespace) < 4 || len(namespace) > 256 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The v2 registry currently has a minimum of 2, not 4: https://github.com/docker/distribution/blob/master/registry/api/v2/names.go#L16

@ncdc
Copy link
Contributor

ncdc commented Mar 5, 2015

The current max in the v2 registry is 255, not 256: https://github.com/docker/distribution/blob/master/registry/api/v2/names.go#L32

@ncdc
Copy link
Contributor

ncdc commented Mar 6, 2015

This PR for the v2 registry removes the 30-character component limit distribution/distribution#242

@crosbymichael
Copy link
Contributor

@dmp42 @dmcgowan

Please review

@dmp42
Copy link
Contributor

dmp42 commented Mar 6, 2015

@shishir-a412ed can you update the comparison to 255?
Thanks.

@dmcgowan
Copy link
Member

dmcgowan commented Mar 7, 2015

Ping @ncdc can you drive forward getting this updated to match the rules in distribution

@dmcgowan dmcgowan added this to the 1.6.0 milestone Mar 7, 2015
@ncdc
Copy link
Contributor

ncdc commented Mar 7, 2015

Yes, I chatted with Shishir today about updating it to match. I'll follow
up on Monday. Thanks.
On Fri, Mar 6, 2015 at 8:53 PM Derek McGowan notifications@github.com
wrote:

Ping @ncdc https://github.com/ncdc can you drive forward getting this
updated to match the rules in distribution


Reply to this email directly or view it on GitHub
#11118 (comment).

@shishir-a412ed shishir-a412ed force-pushed the restriction_username_length branch 3 times, most recently from 63b51a0 to cca2eee Compare March 9, 2015 15:01
@stevvooe stevvooe changed the title Docker Tag command: Relax the restriction on namespace (username) length from 30 to 256 characters. Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters. Mar 9, 2015
@stevvooe
Copy link
Contributor

stevvooe commented Mar 9, 2015

Updated ticket title to reflect the correct limit.

@@ -776,9 +779,6 @@ func TestValidRemoteName(t *testing.T) {
// Disallow consecutive hyphens.
"dock--er/docker",

// Namespace too short.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could replace this with a testcase that triggers the short case?

@stevvooe
Copy link
Contributor

LGTM with testcase for short namespace.

@dmcgowan
Copy link
Member

Commit message hasn't been changed to reflect 255 instead of 256 characters

@shishir-a412ed shishir-a412ed force-pushed the restriction_username_length branch 2 times, most recently from 85ce071 to 593619d Compare March 13, 2015 22:17
@shishir-a412ed
Copy link
Contributor Author

@dmcgowan Updated the commit message to reflect 255.

@shishir-a412ed shishir-a412ed force-pushed the restriction_username_length branch 2 times, most recently from 703d32b to ab3f8eb Compare March 14, 2015 15:30
@shishir-a412ed
Copy link
Contributor Author

@stevvooe I have added 2 testcases, one for short, and one for long namespaces.

…gth from 30 to 255 characters.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
@shishir-a412ed shishir-a412ed force-pushed the restriction_username_length branch from ab3f8eb to 9839e97 Compare March 14, 2015 20:46
@dmcgowan
Copy link
Member

LGTM

1 similar comment
@stevvooe
Copy link
Contributor

LGTM

@ncdc
Copy link
Contributor

ncdc commented Mar 17, 2015

@icecrime what are the next steps here?

@vbatts
Copy link
Contributor

vbatts commented Mar 17, 2015

i've just issued a rebuild to windows, but the linux tests are looking fine.

@icecrime
Copy link
Contributor

Windows CI is green after rebuild: pushing to 3-docs-review.

@ncdc
Copy link
Contributor

ncdc commented Mar 17, 2015

@icecrime thanks. FYI I grepped through the Docker codebase and the only references I could find (quickly) to a 30 character maximum were the docker io API and the hub registry spec docs, both of which talk about hub/registry usernames needing to be no more than 30.

@icecrime
Copy link
Contributor

Good, I was running the same search on my side and can't see any reference to these limits in docs/ either :-) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.