1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

feat(system): path to upgrade swarm to BE [EE-4624] (#8124)

This commit is contained in:
Chaim Lev-Ari 2022-12-13 22:52:06 +02:00 committed by GitHub
parent b59a0ba823
commit db9d87c918
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 21 deletions

View file

@ -8,7 +8,6 @@ import (
httperror "github.com/portainer/libhttp/error"
"github.com/portainer/libhttp/request"
"github.com/portainer/libhttp/response"
"github.com/rs/zerolog/log"
)
type systemUpgradePayload struct {
@ -43,12 +42,10 @@ func (handler *Handler) systemUpgrade(w http.ResponseWriter, r *http.Request) *h
return httperror.BadRequest("Invalid request payload", err)
}
go func() {
err = handler.upgradeService.Upgrade(payload.License)
if err != nil {
log.Error().Err(err).Msg("Failed to upgrade Portainer")
}
}()
err = handler.upgradeService.Upgrade(payload.License)
if err != nil {
return httperror.InternalServerError("Failed to upgrade Portainer", err)
}
return response.Empty(w)
}