diff --git a/cli/app/list.go b/cli/app/list.go index 6f0eec22..9290c543 100644 --- a/cli/app/list.go +++ b/cli/app/list.go @@ -39,13 +39,15 @@ var listAppServerFlag = &cli.StringFlag{ } type appStatus struct { - Server string `json:"server"` - Recipe string `json:"recipe"` - AppName string `json:"appName"` - Domain string `json:"domain"` - Status string `json:"status"` - Version string `json:"version"` - Upgrade string `json:"upgrade"` + Server string `json:"server"` + Recipe string `json:"recipe"` + AppName string `json:"appName"` + Domain string `json:"domain"` + Status string `json:"status"` + Chaos string `json:"chaos"` + ChaosVersion string `json:"chaosVersion"` + Version string `json:"version"` + Upgrade string `json:"upgrade"` } type serverStatus struct { @@ -138,12 +140,20 @@ can take some time. if status { status := "unknown" version := "unknown" + chaos := "unknown" + chaosVersion := "unknown" if statusMeta, ok := statuses[app.StackName()]; ok { if currentVersion, exists := statusMeta["version"]; exists { if currentVersion != "" { version = currentVersion } } + if chaosDeploy, exists := statusMeta["chaos"]; exists { + chaos = chaosDeploy + } + if chaosDeployVersion, exists := statusMeta["chaosVersion"]; exists { + chaosVersion = chaosDeployVersion + } if statusMeta["status"] != "" { status = statusMeta["status"] } @@ -153,6 +163,8 @@ can take some time. } appStats.Status = status + appStats.Chaos = chaos + appStats.ChaosVersion = chaosVersion appStats.Version = version var newUpdates []string @@ -223,7 +235,7 @@ can take some time. tableCol := []string{"recipe", "domain"} if status { - tableCol = append(tableCol, []string{"status", "version", "upgrade"}...) + tableCol = append(tableCol, []string{"status", "chaos", "chaos version", "version", "upgrade"}...) } table := formatter.CreateTable(tableCol) @@ -231,7 +243,7 @@ can take some time. for _, appStat := range serverStat.Apps { tableRow := []string{appStat.Recipe, appStat.Domain} if status { - tableRow = append(tableRow, []string{appStat.Status, appStat.Version, appStat.Upgrade}...) + tableRow = append(tableRow, []string{appStat.Status, appStat.Chaos, appStat.ChaosVersion, appStat.Version, appStat.Upgrade}...) } table.Append(tableRow) } diff --git a/pkg/config/app.go b/pkg/config/app.go index f7c528f5..816bfe7f 100644 --- a/pkg/config/app.go +++ b/pkg/config/app.go @@ -403,7 +403,18 @@ func GetAppStatuses(apps []App, MachineReadable bool) (map[string]map[string]str result["status"] = "deployed" } - labelKey := fmt.Sprintf("coop-cloud.%s.version", name) + labelKey := fmt.Sprintf("coop-cloud.%s.chaos", name) + chaos, ok := service.Spec.Labels[labelKey] + if ok { + result["chaos"] = chaos + } + + labelKey = fmt.Sprintf("coop-cloud.%s.chaos_version", name) + if chaosVersion, ok := service.Spec.Labels[labelKey]; ok { + result["chaosVersion"] = chaosVersion + } + + labelKey = fmt.Sprintf("coop-cloud.%s.version", name) if version, ok := service.Spec.Labels[labelKey]; ok { result["version"] = version } else {