mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix message 'No such image: ubuntu' => 'No such image: ubuntu:latest'
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
parent
964d82d005
commit
626cee87f7
1 changed files with 11 additions and 5 deletions
16
server.go
16
server.go
|
@ -1815,16 +1815,22 @@ func (srv *Server) DeleteImage(name string, imgs *engine.Table, first, force boo
|
||||||
tags = []string{}
|
tags = []string{}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
repoName, tag = utils.ParseRepositoryTag(name)
|
||||||
|
if tag == "" {
|
||||||
|
tag = DEFAULTTAG
|
||||||
|
}
|
||||||
|
|
||||||
img, err := srv.runtime.repositories.LookupImage(name)
|
img, err := srv.runtime.repositories.LookupImage(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if r, _ := srv.runtime.repositories.Get(repoName); r != nil {
|
||||||
|
return fmt.Errorf("No such image: %s:%s", repoName, tag)
|
||||||
|
}
|
||||||
return fmt.Errorf("No such image: %s", name)
|
return fmt.Errorf("No such image: %s", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.Contains(img.ID, name) {
|
if strings.Contains(img.ID, name) {
|
||||||
repoName, tag = utils.ParseRepositoryTag(name)
|
repoName = ""
|
||||||
if tag == "" {
|
tag = ""
|
||||||
tag = DEFAULTTAG
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
byParents, err := srv.runtime.graph.ByParent()
|
byParents, err := srv.runtime.graph.ByParent()
|
||||||
|
|
Loading…
Add table
Reference in a new issue