forked from TrueCloudLab/distribution
Merge pull request #1408 from dotcloud/1407-localhost_is_a_domain-fix
Always consider localhost as a domain name when parsing the FQN repos name
This commit is contained in:
commit
0e12ec253d
1 changed files with 2 additions and 1 deletions
|
@ -69,7 +69,8 @@ func ResolveRepositoryName(reposName string) (string, string, error) {
|
||||||
return "", "", ErrInvalidRepositoryName
|
return "", "", ErrInvalidRepositoryName
|
||||||
}
|
}
|
||||||
nameParts := strings.SplitN(reposName, "/", 2)
|
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)
|
// This is a Docker Index repos (ex: samalba/hipache or ubuntu)
|
||||||
err := validateRepositoryName(reposName)
|
err := validateRepositoryName(reposName)
|
||||||
return auth.IndexServerAddress(), reposName, err
|
return auth.IndexServerAddress(), reposName, err
|
||||||
|
|
Loading…
Reference in a new issue