Skip to content

Commit

Permalink
fix reported compat issues
Browse files Browse the repository at this point in the history
honor -1 in in list containers for compatibility mode.  it is commonly used to indicate no limit.

change the json id parameter to Id in container create.

Fixes: #5553

Signed-off-by: Brent Baude <[email protected]>
  • Loading branch information
baude committed Mar 19, 2020
1 parent e87fe4d commit d375424
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/api/handlers/compat/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
utils.InternalServerError(w, err)
return
}
if _, found := r.URL.Query()["limit"]; found {
if _, found := r.URL.Query()["limit"]; found && query.Limit != -1 {
last := query.Limit
if len(containers) > last {
containers = containers[len(containers)-last:]
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/handlers/utils/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// ContainerCreateResponse is the response struct for creating a container
type ContainerCreateResponse struct {
// ID of the container created
ID string `json:"id"`
ID string `json:"Id"`
// Warnings during container creation
Warnings []string `json:"Warnings"`
}
Expand Down

0 comments on commit d375424

Please sign in to comment.