mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix wrong untag when using rmi via id
This commit is contained in:
parent
422378cb85
commit
e608296bc6
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue