зеркало из https://github.com/microsoft/docker.git
Fixed tag parsing when the repos name contains both a port and a tag
This commit is contained in:
Родитель
59b785a282
Коммит
e8db031112
8
tags.go
8
tags.go
|
@ -70,11 +70,11 @@ func (store *TagStore) LookupImage(name string) (*Image, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// FIXME: standardize on returning nil when the image doesn't exist, and err for everything else
|
// FIXME: standardize on returning nil when the image doesn't exist, and err for everything else
|
||||||
// (so we can pass all errors here)
|
// (so we can pass all errors here)
|
||||||
repoAndTag := strings.SplitN(name, ":", 2)
|
repos, tag := utils.ParseRepositoryTag(name)
|
||||||
if len(repoAndTag) == 1 {
|
if tag == "" {
|
||||||
repoAndTag = append(repoAndTag, DEFAULTTAG)
|
tag = DEFAULTTAG
|
||||||
}
|
}
|
||||||
if i, err := store.GetImage(repoAndTag[0], repoAndTag[1]); err != nil {
|
if i, err := store.GetImage(repos, tag); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if i == nil {
|
} else if i == nil {
|
||||||
return nil, fmt.Errorf("Image does not exist: %s", name)
|
return nil, fmt.Errorf("Image does not exist: %s", name)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче