From 873989f7a413ee8acc5e137577dfaa4d38f94fbd Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Wed, 23 Sep 2020 13:21:23 +0800 Subject: apiv2 container limit differ from docker-api Signed-off-by: zhangguanzhang --- pkg/api/handlers/compat/containers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go index 1c2356b92..63c44eaef 100644 --- a/pkg/api/handlers/compat/containers.go +++ b/pkg/api/handlers/compat/containers.go @@ -85,7 +85,7 @@ func ListContainers(w http.ResponseWriter, r *http.Request) { utils.InternalServerError(w, err) return } - if _, found := r.URL.Query()["limit"]; found && query.Limit != -1 { + if _, found := r.URL.Query()["limit"]; found && query.Limit > 0 { last := query.Limit if len(containers) > last { containers = containers[len(containers)-last:] -- cgit v1.2.3-54-g00ecf