feat(list): show autoupdate state
This commit is contained in:
parent
3753357ef8
commit
d120299929
@ -46,6 +46,7 @@ type appStatus struct {
|
|||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Chaos string `json:"chaos"`
|
Chaos string `json:"chaos"`
|
||||||
ChaosVersion string `json:"chaosVersion"`
|
ChaosVersion string `json:"chaosVersion"`
|
||||||
|
AutoUpdate string `json:"autoUpdate"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Upgrade string `json:"upgrade"`
|
Upgrade string `json:"upgrade"`
|
||||||
}
|
}
|
||||||
@ -142,6 +143,7 @@ can take some time.
|
|||||||
version := "unknown"
|
version := "unknown"
|
||||||
chaos := "unknown"
|
chaos := "unknown"
|
||||||
chaosVersion := "unknown"
|
chaosVersion := "unknown"
|
||||||
|
autoUpdate := "unknown"
|
||||||
if statusMeta, ok := statuses[app.StackName()]; ok {
|
if statusMeta, ok := statuses[app.StackName()]; ok {
|
||||||
if currentVersion, exists := statusMeta["version"]; exists {
|
if currentVersion, exists := statusMeta["version"]; exists {
|
||||||
if currentVersion != "" {
|
if currentVersion != "" {
|
||||||
@ -154,6 +156,9 @@ can take some time.
|
|||||||
if chaosDeployVersion, exists := statusMeta["chaosVersion"]; exists {
|
if chaosDeployVersion, exists := statusMeta["chaosVersion"]; exists {
|
||||||
chaosVersion = chaosDeployVersion
|
chaosVersion = chaosDeployVersion
|
||||||
}
|
}
|
||||||
|
if autoUpdateState, exists := statusMeta["autoUpdate"]; exists {
|
||||||
|
autoUpdate = autoUpdateState
|
||||||
|
}
|
||||||
if statusMeta["status"] != "" {
|
if statusMeta["status"] != "" {
|
||||||
status = statusMeta["status"]
|
status = statusMeta["status"]
|
||||||
}
|
}
|
||||||
@ -166,6 +171,7 @@ can take some time.
|
|||||||
appStats.Chaos = chaos
|
appStats.Chaos = chaos
|
||||||
appStats.ChaosVersion = chaosVersion
|
appStats.ChaosVersion = chaosVersion
|
||||||
appStats.Version = version
|
appStats.Version = version
|
||||||
|
appStats.AutoUpdate = autoUpdate
|
||||||
|
|
||||||
var newUpdates []string
|
var newUpdates []string
|
||||||
if version != "unknown" {
|
if version != "unknown" {
|
||||||
@ -235,7 +241,7 @@ can take some time.
|
|||||||
|
|
||||||
tableCol := []string{"recipe", "domain"}
|
tableCol := []string{"recipe", "domain"}
|
||||||
if status {
|
if status {
|
||||||
tableCol = append(tableCol, []string{"status", "chaos", "chaos version", "version", "upgrade"}...)
|
tableCol = append(tableCol, []string{"status", "chaos", "chaos version", "version", "upgrade", "autoupdate"}...)
|
||||||
}
|
}
|
||||||
|
|
||||||
table := formatter.CreateTable(tableCol)
|
table := formatter.CreateTable(tableCol)
|
||||||
@ -243,7 +249,7 @@ can take some time.
|
|||||||
for _, appStat := range serverStat.Apps {
|
for _, appStat := range serverStat.Apps {
|
||||||
tableRow := []string{appStat.Recipe, appStat.Domain}
|
tableRow := []string{appStat.Recipe, appStat.Domain}
|
||||||
if status {
|
if status {
|
||||||
tableRow = append(tableRow, []string{appStat.Status, appStat.Chaos, appStat.ChaosVersion, appStat.Version, appStat.Upgrade}...)
|
tableRow = append(tableRow, []string{appStat.Status, appStat.Chaos, appStat.ChaosVersion, appStat.Version, appStat.Upgrade, appStat.AutoUpdate}...)
|
||||||
}
|
}
|
||||||
table.Append(tableRow)
|
table.Append(tableRow)
|
||||||
}
|
}
|
||||||
|
@ -414,6 +414,13 @@ func GetAppStatuses(apps []App, MachineReadable bool) (map[string]map[string]str
|
|||||||
result["chaosVersion"] = chaosVersion
|
result["chaosVersion"] = chaosVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
labelKey = fmt.Sprintf("coop-cloud.%s.autoupdate", name)
|
||||||
|
if autoUpdate, ok := service.Spec.Labels[labelKey]; ok {
|
||||||
|
result["autoUpdate"] = autoUpdate
|
||||||
|
} else {
|
||||||
|
result["autoUpdate"] = "false"
|
||||||
|
}
|
||||||
|
|
||||||
labelKey = fmt.Sprintf("coop-cloud.%s.version", name)
|
labelKey = fmt.Sprintf("coop-cloud.%s.version", name)
|
||||||
if version, ok := service.Spec.Labels[labelKey]; ok {
|
if version, ok := service.Spec.Labels[labelKey]; ok {
|
||||||
result["version"] = version
|
result["version"] = version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user