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

Merge pull request #1358 from wansir/master

support querying resources without paging
......@@ -37,12 +37,9 @@ func ParsePaging(paging string) (limit, offset int) {
limit = 10
offset = 0
if groups := regexp.MustCompile(`^limit=(\d+),page=(\d+)$`).FindStringSubmatch(paging); len(groups) == 3 {
if groups := regexp.MustCompile(`^limit=(-?\d+),page=(\d+)$`).FindStringSubmatch(paging); len(groups) == 3 {
limit, _ = strconv.Atoi(groups[1])
page, _ := strconv.Atoi(groups[2])
if page < 0 {
page = 1
}
offset = (page - 1) * limit
}
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册