fix(stacks): migrate stack resource control [EE-2412] (#6424)

fixes [EE-2412]
pull/6393/head
Chaim Lev-Ari 2022-01-23 09:16:39 +02:00 committed by GitHub
parent 661f0aad49
commit 804fdd414e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -156,6 +156,14 @@ func (handler *Handler) stackMigrate(w http.ResponseWriter, r *http.Request) *ht
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: "Unable to persist the stack changes inside the database", Err: err}
}
if resourceControl != nil {
resourceControl.ResourceID = stackutils.ResourceControlID(stack.EndpointID, stack.Name)
err := handler.DataStore.ResourceControl().UpdateResourceControl(resourceControl.ID, resourceControl)
if err != nil {
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to persist the resource control changes", err}
}
}
if stack.GitConfig != nil && stack.GitConfig.Authentication != nil && stack.GitConfig.Authentication.Password != "" {
// sanitize password in the http response to minimise possible security leaks
stack.GitConfig.Authentication.Password = ""