From 1ee363f8c99878a15836acc2b48a0c146221f7b1 Mon Sep 17 00:00:00 2001 From: Marcelo Rydel Date: Tue, 12 Oct 2021 18:48:28 -0300 Subject: [PATCH] overrite stack name for update (#5743) --- api/http/handler/stacks/stack_migrate.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/http/handler/stacks/stack_migrate.go b/api/http/handler/stacks/stack_migrate.go index 5cdb17a6b..e26f2dd93 100644 --- a/api/http/handler/stacks/stack_migrate.go +++ b/api/http/handler/stacks/stack_migrate.go @@ -143,12 +143,14 @@ func (handler *Handler) stackMigrate(w http.ResponseWriter, r *http.Request) *ht return migrationError } + newName := stack.Name stack.Name = oldName err = handler.deleteStack(securityContext.UserID, stack, endpoint) if err != nil { return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: err.Error(), Err: err} } + stack.Name = newName err = handler.DataStore.Stack().UpdateStack(stack.ID, stack) if err != nil { return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: "Unable to persist the stack changes inside the database", Err: err}