Skip to content

Commit

Permalink
Merge pull request #8681 from Luap99/fix-image-exists-panic
Browse files Browse the repository at this point in the history
Fix panic in libpod images exists endpoint
  • Loading branch information
openshift-merge-robot authored Dec 10, 2020
2 parents deb0042 + 3fa61f0 commit 2bb1490
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/api/handlers/libpod/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func ImageExists(w http.ResponseWriter, r *http.Request) {
return
}
if !report.Value {
utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(nil, "failed to find image %s", name))
utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Errorf("failed to find image %s", name))
return
}
utils.WriteResponse(w, http.StatusNoContent, "")
Expand Down
2 changes: 2 additions & 0 deletions test/apiv2/10-images.at
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ iid=$(jq -r '.[0].Id' <<<"$output")

t GET libpod/images/$iid/exists 204
t GET libpod/images/$PODMAN_TEST_IMAGE_NAME/exists 204
t GET libpod/images/${iid}abcdef/exists 404 \
.cause="failed to find image ${iid}abcdef"

# FIXME: compare to actual podman info
t GET libpod/images/json 200 \
Expand Down

0 comments on commit 2bb1490

Please sign in to comment.