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:
Victor Vieux 2014-02-18 03:03:19 +00:00
parent 964d82d005
commit 626cee87f7
1 changed files with 11 additions and 5 deletions

View File

@ -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()