Improve error message when refusing to remove image due to multiple repo tags

This commit is contained in:
Danny Yates 2013-12-17 12:31:35 +00:00
parent 124da338fd
commit c3705e83e7
2 changed files with 2 additions and 2 deletions

View file

@ -952,7 +952,7 @@ image is removed.
test2 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB)
$ sudo docker rmi fd484f19954f
Error: Conflict, fd484f19954f wasn't deleted
Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories
2013/12/11 05:47:16 Error: failed to remove one or more images
$ sudo docker rmi test1

View file

@ -1567,7 +1567,7 @@ func (srv *Server) deleteImage(img *Image, repoName, tag string) ([]APIRmi, erro
} else if repoName != parsedRepo {
// the id belongs to multiple repos, like base:latest and user:test,
// in that case return conflict
return imgs, nil
return nil, fmt.Errorf("Conflict, cannot delete image %s because it is tagged in multiple repositories", utils.TruncateID(img.ID))
}
}
} else {