Skip to content

Commit

Permalink
Add missing return after utils.InternalServerError()
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sjölund <[email protected]>
  • Loading branch information
eriksjolund committed Jul 12, 2023
1 parent 7cd1fb7 commit 6ec261e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/api/handlers/libpod/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ func PodStats(w http.ResponseWriter, r *http.Request) {
options := entities.PodStatsOptions{All: query.All}
if err := entities.ValidatePodStatsOptions(query.NamesOrIDs, &options); err != nil {
utils.InternalServerError(w, err)
return
}

var flush = func() {}
Expand Down
4 changes: 4 additions & 0 deletions test/apiv2/40-pods.at
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ t GET libpod/pods/stats?namesOrIDs=fakename 404 \
.cause="no such pod" \
.message="unable to get list of pods: no pod with name or ID fakename found: no such pod"

t GET "libpod/pods/stats?all=true&namesOrIDs=foo" 500 \
.cause="--all, --latest and arguments cannot be used together" \
.message="--all, --latest and arguments cannot be used together"

t DELETE libpod/pods/bar?force=true 200

# test the fake name
Expand Down

0 comments on commit 6ec261e

Please sign in to comment.