Skip to content
Snippets Groups Projects
Commit e608296b authored by Victor Vieux's avatar Victor Vieux
Browse files

fix wrong untag when using rmi via id

parent 422378cb
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment