Merge pull request #2827 from zheng1/op_bugfix1

Bugfix: catch error from ParseConditions and refactor ParseConditions
This commit is contained in:
KubeSphere CI Bot
2020-08-11 12:53:55 +08:00
committed by GitHub
3 changed files with 215 additions and 24 deletions

View File

@@ -867,6 +867,12 @@ func (h *openpitrixHandler) ListRepos(req *restful.Request, resp *restful.Respon
reverse := params.GetBoolValueWithDefault(req, params.ReverseParam, false)
conditions, err := params.ParseConditions(req)
if err != nil {
klog.V(4).Infoln(err)
api.HandleBadRequest(resp, nil, err)
return
}
if req.PathParameter("workspace") != "" {
conditions.Match[openpitrix.WorkspaceLabel] = req.PathParameter("workspace")
}