mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
overrite stack name for update (#5743)
This commit is contained in:
parent
109b27594a
commit
1ee363f8c9
1 changed files with 2 additions and 0 deletions
|
@ -143,12 +143,14 @@ func (handler *Handler) stackMigrate(w http.ResponseWriter, r *http.Request) *ht
|
||||||
return migrationError
|
return migrationError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newName := stack.Name
|
||||||
stack.Name = oldName
|
stack.Name = oldName
|
||||||
err = handler.deleteStack(securityContext.UserID, stack, endpoint)
|
err = handler.deleteStack(securityContext.UserID, stack, endpoint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: err.Error(), Err: err}
|
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: err.Error(), Err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stack.Name = newName
|
||||||
err = handler.DataStore.Stack().UpdateStack(stack.ID, stack)
|
err = handler.DataStore.Stack().UpdateStack(stack.ID, stack)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: "Unable to persist the stack changes inside the database", Err: err}
|
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: "Unable to persist the stack changes inside the database", Err: err}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue