未验证 提交 09aa2782 编写于 作者: K KubeSphere CI Bot 提交者: GitHub

Merge pull request #1626 from zehuaiWANG/kubesphere-review

modified the resources
......@@ -160,10 +160,13 @@ func ListResources(namespace, resource string, conditions *params.Conditions, or
return nil, err
}
for i, item := range result {
if i >= offset && (limit == -1 || len(items) < limit) {
items = append(items, injector.addExtraAnnotations(item))
}
if limit == -1 || limit+offset > len(result) {
limit = len(result) - offset
}
result = result[offset : offset+limit]
for _, item := range result {
items = append(items, injector.addExtraAnnotations(item))
}
return &models.PageableResponse{TotalCount: len(result), Items: items}, nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册