fix(app): fix app list chaos field

show only the chaos version if the app is a chaos deploy
This commit is contained in:
Moritz 2023-04-14 18:01:08 +02:00
parent 31ec322c55
commit 27cac81830

View File

@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"sort"
"strconv"
"strings"
"coopcloud.tech/abra/cli/internal"
@ -249,11 +250,15 @@ can take some time.
for _, appStat := range serverStat.Apps {
tableRow := []string{appStat.Recipe, appStat.Domain}
if status {
chaosStatus := "unknown"
if appStat.ChaosVersion != "unknown" {
chaosStatus = appStat.ChaosVersion
} else {
chaosStatus = appStat.Chaos
chaosStatus := appStat.Chaos
if chaosStatus != "unknown" {
chaosEnabled, err := strconv.ParseBool(chaosStatus)
if err != nil {
logrus.Fatal(err)
}
if chaosEnabled && appStat.ChaosVersion != "unknown" {
chaosStatus = appStat.ChaosVersion
}
}
tableRow = append(tableRow, []string{appStat.Status, chaosStatus, appStat.Version, appStat.Upgrade, appStat.AutoUpdate}...)
}