fix wrong untag when using rmi via id

Upstream-commit: e608296bc62ceeaf41ebf2bc80b21c0a1883d4f0
Component: engine
This commit is contained in:
Victor Vieux
2013-07-26 09:19:26 +00:00
parent 41fd022aa4
commit 8f7401af36

View File

@ -995,6 +995,9 @@ func (srv *Server) deleteImage(img *Image, repoName, tag string) ([]APIRmi, erro
parsedRepo := strings.Split(repoAndTag, ":")[0]
if strings.Contains(img.ID, repoName) {
repoName = parsedRepo
if len(strings.Split(repoAndTag, ":")) > 1 {
tag = strings.Split(repoAndTag, ":")[1]
}
} else if repoName != parsedRepo {
// the id belongs to multiple repos, like base:latest and user:test,
// in that case return conflict