Skip to content

Commit

Permalink
fix: Handle restarted status in same way as deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
mzottola committed Sep 14, 2023
1 parent 1a4b418 commit f7d13a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/qovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ func GetEnvironmentStatusWithColor(statuses []qovery.EnvironmentStatus, serviceI
func GetStatusTextWithColor(s qovery.StateEnum) string {
var statusMsg string

if s == qovery.STATEENUM_DEPLOYED {
if s == qovery.STATEENUM_DEPLOYED || s == qovery.STATEENUM_RESTARTED {
statusMsg = pterm.FgGreen.Sprintf(string(s))
} else if strings.HasSuffix(string(s), "ERROR") {
statusMsg = pterm.FgRed.Sprintf(string(s))
Expand Down Expand Up @@ -950,6 +950,7 @@ func WatchEnvironmentWithOptions(envId string, finalServiceState qovery.StateEnu
}

if statuses.Environment.LastDeploymentState == qovery.STATEENUM_DEPLOYED ||
statuses.Environment.LastDeploymentState == qovery.STATEENUM_RESTARTED ||
statuses.Environment.LastDeploymentState == qovery.STATEENUM_DELETED ||
statuses.Environment.LastDeploymentState == qovery.STATEENUM_STOPPED ||
statuses.Environment.LastDeploymentState == qovery.STATEENUM_CANCELED {
Expand Down Expand Up @@ -1086,7 +1087,8 @@ func WatchStatus(status *qovery.Status) Status {
log.Println(GetStatusTextWithColor(status.State))

if status.State == qovery.STATEENUM_DEPLOYED || status.State == qovery.STATEENUM_DELETED ||
status.State == qovery.STATEENUM_STOPPED || status.State == qovery.STATEENUM_CANCELED {
status.State == qovery.STATEENUM_STOPPED || status.State == qovery.STATEENUM_CANCELED ||
status.State == qovery.STATEENUM_RESTARTED {
return Stop
}

Expand Down

0 comments on commit f7d13a9

Please sign in to comment.