Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
This commit is contained in:
Shishir Mahajan 2015-03-02 16:11:49 -05:00
parent c5c507bb14
commit dc4e9c6e90
2 changed files with 11 additions and 5 deletions

View file

@ -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) < 2 || len(namespace) > 255 {
return fmt.Errorf("Invalid namespace name (%s). Cannot be fewer than 2 or more than 255 characters.", namespace)
}
if strings.HasPrefix(namespace, "-") || strings.HasSuffix(namespace, "-") {
return fmt.Errorf("Invalid namespace name (%s). Cannot begin or end with a hyphen.", namespace)