mirror of https://github.com/docker/docs.git
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
18
server.go
18
server.go
|
@ -1815,16 +1815,22 @@ func (srv *Server) DeleteImage(name string, imgs *engine.Table, first, force boo
|
||||||
tags = []string{}
|
tags = []string{}
|
||||||
)
|
)
|
||||||
|
|
||||||
img, err := srv.runtime.repositories.LookupImage(name)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("No such image: %s", name)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !strings.Contains(img.ID, name) {
|
|
||||||
repoName, tag = utils.ParseRepositoryTag(name)
|
repoName, tag = utils.ParseRepositoryTag(name)
|
||||||
if tag == "" {
|
if tag == "" {
|
||||||
tag = DEFAULTTAG
|
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 = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
byParents, err := srv.runtime.graph.ByParent()
|
byParents, err := srv.runtime.graph.ByParent()
|
||||||
|
|
Loading…
Reference in New Issue