Merge pull request #7725 from erikh/fix_registry_test

fix return values in registry mock service
This commit is contained in:
Michael Crosby 2014-08-25 10:56:00 -07:00
commit 95eb88f647

View file

@ -236,6 +236,7 @@ func handlerGetDeleteTags(w http.ResponseWriter, r *http.Request) {
tags, exists := testRepositories[repositoryName]
if !exists {
apiError(w, "Repository not found", 404)
return
}
if r.Method == "DELETE" {
delete(testRepositories, repositoryName)
@ -255,10 +256,12 @@ func handlerGetTag(w http.ResponseWriter, r *http.Request) {
tags, exists := testRepositories[repositoryName]
if !exists {
apiError(w, "Repository not found", 404)
return
}
tag, exists := tags[tagName]
if !exists {
apiError(w, "Tag not found", 404)
return
}
writeResponse(w, tag, 200)
}