Merge pull request #3279 from LinuxSuRen/fix-pipe-list
Fix the pipeline list with incorrect paging calculating
This commit is contained in:
@@ -94,9 +94,10 @@ func (h *ProjectPipelineHandler) ListPipelines(req *restful.Request, resp *restf
|
||||
// get all pipelines which come from ks
|
||||
pipelineList := &clientDevOps.PipelineList{
|
||||
Total: objs.TotalItems,
|
||||
Items: make([]clientDevOps.Pipeline, objs.TotalItems),
|
||||
Items: make([]clientDevOps.Pipeline, len(objs.Items)),
|
||||
}
|
||||
pipelineMap := make(map[string]int, objs.TotalItems)
|
||||
if pipelineList.Total > 0 && len(objs.Items) > 0 {
|
||||
pipelineMap := make(map[string]int, pipelineList.Total)
|
||||
for i, item := range objs.Items {
|
||||
if pipeline, ok := item.(v1alpha3.Pipeline); !ok {
|
||||
continue
|
||||
@@ -122,6 +123,7 @@ func (h *ProjectPipelineHandler) ListPipelines(req *restful.Request, resp *restf
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resp.Header().Set(restful.HEADER_ContentType, restful.MIME_JSON)
|
||||
resp.WriteAsJson(pipelineList)
|
||||
|
||||
Reference in New Issue
Block a user