adding not a registry
parent
deb75d8e47
commit
9cc4ef4812
|
@ -14,6 +14,8 @@ const (
|
|||
// DefaultTag defines the default tag used when performing images related actions and no tag or digest is specified
|
||||
DefaultTag = "latest"
|
||||
// DefaultRegistryHostname is the default built-in hostname
|
||||
// DefaultRegistryHostname = "index.docker.io"
|
||||
WrongRegistryHostname = "docker.io"
|
||||
DefaultRegistryHostname = "index.docker.io"
|
||||
|
||||
// DefaultScheme is default scheme for registries
|
||||
|
@ -66,10 +68,12 @@ type Canonical interface {
|
|||
// returned.
|
||||
// If an error was encountered it is returned, along with a nil Reference.
|
||||
func ParseNamed(s string) (Named, error) {
|
||||
named, err := reference.ParseNamed(s)
|
||||
|
||||
named, err := reference.ParseNormalizedNamed(s)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error parsing reference: %q is not a valid repository/tag", s)
|
||||
return nil, fmt.Errorf("Error parsing reference: %q is not a valid repository/tag, error: %s", s, err)
|
||||
}
|
||||
|
||||
r, err := WithName(named.Name())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -179,9 +183,9 @@ func splitHostname(name string) (hostname, remoteName string) {
|
|||
} else {
|
||||
hostname, remoteName = name[:i], name[i+1:]
|
||||
}
|
||||
// if hostname == LegacyDefaultHostname {
|
||||
// hostname = DefaultHostname
|
||||
// }
|
||||
if hostname == WrongRegistryHostname {
|
||||
hostname = DefaultRegistryHostname
|
||||
}
|
||||
if hostname == DefaultRegistryHostname && !strings.ContainsRune(remoteName, '/') {
|
||||
remoteName = DefaultRepoPrefix + remoteName
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue