Merge pull request #1626 from zehuaiWANG/kubesphere-review

modified the resources
This commit is contained in:
KubeSphere CI Bot
2019-12-09 14:29:46 +08:00
committed by GitHub

View File

@@ -160,10 +160,13 @@ func ListResources(namespace, resource string, conditions *params.Conditions, or
return nil, err return nil, err
} }
for i, item := range result { if limit == -1 || limit+offset > len(result) {
if i >= offset && (limit == -1 || len(items) < limit) { limit = len(result) - offset
items = append(items, injector.addExtraAnnotations(item)) }
}
result = result[offset : offset+limit]
for _, item := range result {
items = append(items, injector.addExtraAnnotations(item))
} }
return &models.PageableResponse{TotalCount: len(result), Items: items}, nil return &models.PageableResponse{TotalCount: len(result), Items: items}, nil