app ls --status
shows more detailles about the deployment state
#280
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
moritz marked this conversation as resolved
Outdated
|
||||
if chaosVersion, ok := service.Spec.Labels[labelKey]; ok {
|
||||
result["chaosVersion"] = chaosVersion
|
||||
}
|
||||
|
||||
labelKey = fmt.Sprintf("coop-cloud.%s.version", name)
|
||||
decentral1se marked this conversation as resolved
Outdated
decentral1se
commented
Is Is `autoupdate` -> `auto-update` potentially more readable?
moritz
commented
This would be a bit more readable but it would break kadabra for for all apps that are deployed with the current abra version. This would be a bit more readable but it would break kadabra for for all apps that are deployed with the current abra version.
Kadabra is still alpha, so breaking changes are part of it, but I don't think this label change is really worth the effort to redeploy all apps after the next abra release.
|
||||
if version, ok := service.Spec.Labels[labelKey]; ok {
|
||||
result["version"] = version
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user
chaos_version
->chaos-version
following the convention of-
? This would require updating in several places in this PR.