Bugfix: create repo have no workspace

Signed-off-by: Zhengyi Lai <zheng1@yunify.com>
This commit is contained in:
Zhengyi Lai
2020-07-23 16:56:48 +08:00
parent 616fcb1740
commit 36ec2cdc9e

View File

@@ -753,6 +753,14 @@ func (h *openpitrixHandler) CreateRepo(req *restful.Request, resp *restful.Respo
api.HandleBadRequest(resp, nil, err)
return
}
if req.PathParameter("workspace") != "" {
if createRepoRequest.Workspace == nil {
createRepoRequest.Workspace = new(string)
}
*createRepoRequest.Workspace = req.PathParameter("workspace")
}
validate, _ := strconv.ParseBool(req.QueryParameter("validate"))
var result interface{}