-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters. #11118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters. #11118
Conversation
@@ -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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
f3870dd
to
a8cc254
Compare
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 { |
There was a problem hiding this comment.
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
The current max in the v2 registry is 255, not 256: https://github.com/docker/distribution/blob/master/registry/api/v2/names.go#L32 |
This PR for the v2 registry removes the 30-character component limit distribution/distribution#242 |
@shishir-a412ed can you update the comparison to 255? |
Ping @ncdc can you drive forward getting this updated to match the rules in distribution |
Yes, I chatted with Shishir today about updating it to match. I'll follow
|
63b51a0
to
cca2eee
Compare
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. |
There was a problem hiding this comment.
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?
LGTM with testcase for short namespace. |
Commit message hasn't been changed to reflect 255 instead of 256 characters |
85ce071
to
593619d
Compare
@dmcgowan Updated the commit message to reflect 255. |
703d32b
to
ab3f8eb
Compare
@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>
ab3f8eb
to
9839e97
Compare
LGTM |
1 similar comment
LGTM |
@icecrime what are the next steps here? |
i've just issued a rebuild to windows, but the linux tests are looking fine. |
Windows CI is green after rebuild: pushing to |
@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. |
Good, I was running the same search on my side and can't see any reference to these limits in |
…ngth Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters.
This change relaxes the restriction on namespace (username) from 30 to 255 characters.
Issue related to this: #10392
Shishir