Skip to content

Commit

Permalink
add missing ParseRepositoryTag
Browse files Browse the repository at this point in the history
  • Loading branch information
vieux committed Aug 14, 2013
1 parent 4cb57a5 commit c84d74d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,11 @@ func (srv *Server) deleteImage(img *Image, repoName, tag string) ([]APIRmi, erro
//If delete by id, see if the id belong only to one repository
if strings.Contains(img.ID, repoName) && tag == "" {
for _, repoAndTag := range srv.runtime.repositories.ByID()[img.ID] {
parsedRepo := strings.Split(repoAndTag, ":")[0]
parsedRepo, parsedTag := utils.ParseRepositoryTag(repoAndTag)
if strings.Contains(img.ID, repoName) {
repoName = parsedRepo
if len(srv.runtime.repositories.ByID()[img.ID]) == 1 && len(strings.Split(repoAndTag, ":")) > 1 {
tag = strings.Split(repoAndTag, ":")[1]
if len(srv.runtime.repositories.ByID()[img.ID]) == 1 && len(parsedTag) > 1 {
tag = parsedTag
}
} else if repoName != parsedRepo {
// the id belongs to multiple repos, like base:latest and user:test,
Expand Down

0 comments on commit c84d74d

Please sign in to comment.