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
16
server.go
16
server.go
|
@ -1815,16 +1815,22 @@ func (srv *Server) DeleteImage(name string, imgs *engine.Table, first, force boo
|
|||
tags = []string{}
|
||||
)
|
||||
|
||||
repoName, tag = utils.ParseRepositoryTag(name)
|
||||
if tag == "" {
|
||||
tag = DEFAULTTAG
|
||||
}
|
||||
|
||||
img, err := srv.runtime.repositories.LookupImage(name)
|
||||
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)
|
||||
}
|
||||
|
||||
if !strings.Contains(img.ID, name) {
|
||||
repoName, tag = utils.ParseRepositoryTag(name)
|
||||
if tag == "" {
|
||||
tag = DEFAULTTAG
|
||||
}
|
||||
if strings.Contains(img.ID, name) {
|
||||
repoName = ""
|
||||
tag = ""
|
||||
}
|
||||
|
||||
byParents, err := srv.runtime.graph.ByParent()
|
||||
|
|
Loading…
Reference in New Issue