Merge pull request #3767 from xyz-li/app-fix

Fix: validate repo when modify url
This commit is contained in:
KubeSphere CI Bot
2021-05-08 10:47:34 +08:00
committed by GitHub
2 changed files with 14 additions and 4 deletions

View File

@@ -202,8 +202,12 @@ func (h *openpitrixHandler) ModifyRepo(req *restful.Request, resp *restful.Respo
err = h.openpitrix.ModifyRepo(repoId, &updateRepoRequest)
if err != nil {
klog.Errorln(err)
handleOpenpitrixError(resp, err)
klog.Error(err)
if apierrors.IsNotFound(err) {
api.HandleNotFound(resp, nil, err)
return
}
api.HandleBadRequest(resp, nil, err)
return
} else {
klog.V(4).Info("modify repo: ", repoId)