mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 03:37:46 +08:00
fix update app name to space bug
This commit is contained in:
parent
bcc1d5084f
commit
823d0af061
@ -88,13 +88,16 @@ func (a *ApplicationController) UpdateApp(w http.ResponseWriter, r *http.Request
|
||||
return
|
||||
}
|
||||
app := r.Context().Value(ctxutil.ContextKey("application")).(*dbmodel.Application)
|
||||
if app.K8sApp == "" && updateAppReq.K8sApp == "" {
|
||||
updateAppReq.K8sApp = fmt.Sprintf("app-%s", app.AppID[:8])
|
||||
}
|
||||
if updateAppReq.K8sApp != "" && len(k8svalidation.IsQualifiedName(updateAppReq.K8sApp)) > 0 {
|
||||
httputil.ReturnBcodeError(r, w, bcode.ErrInvaildK8sApp)
|
||||
return
|
||||
}
|
||||
if updateAppReq.K8sApp == "" {
|
||||
updateAppReq.K8sApp = fmt.Sprintf("app-%s", app.AppID[:8])
|
||||
if app.K8sApp != "" {
|
||||
updateAppReq.K8sApp = app.K8sApp
|
||||
}
|
||||
}
|
||||
// update app
|
||||
app, err := handler.GetApplicationHandler().UpdateApp(r.Context(), app, updateAppReq)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user