1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Always consider localhost as a domain name when parsing the FQN repos name

This commit is contained in:
Sam Alba 2013-08-04 17:59:12 -07:00
parent 4dcc0f316c
commit c22f2617ad

View file

@ -69,7 +69,8 @@ func ResolveRepositoryName(reposName string) (string, string, error) {
return "", "", ErrInvalidRepositoryName
}
nameParts := strings.SplitN(reposName, "/", 2)
if !strings.Contains(nameParts[0], ".") && !strings.Contains(nameParts[0], ":") {
if !strings.Contains(nameParts[0], ".") && !strings.Contains(nameParts[0], ":") &&
nameParts[0] != "localhost" {
// This is a Docker Index repos (ex: samalba/hipache or ubuntu)
err := validateRepositoryName(reposName)
return auth.IndexServerAddress(), reposName, err