fix: manage multiple version showing edge cases

This commit is contained in:
2021-10-08 10:50:48 +02:00
parent dde8afcd43
commit c764243f3a
2 changed files with 25 additions and 7 deletions

View File

@ -299,8 +299,8 @@ func GetAppStatuses(appFiles AppFiles) (map[string]map[string]string, error) {
for range servers {
status := <-ch
result := make(map[string]string)
for _, service := range status.Services {
result := make(map[string]string)
name := service.Spec.Labels[convert.LabelNamespace]
if _, ok := statuses[name]; !ok {
@ -310,6 +310,11 @@ func GetAppStatuses(appFiles AppFiles) (map[string]map[string]string, error) {
labelKey := fmt.Sprintf("coop-cloud.%s.version", name)
if version, ok := service.Spec.Labels[labelKey]; ok {
result["version"] = version
} else {
//FIXME: we only need to check containers with the version label not
// every single container and then skip when we see no label perf gains
// to be had here
continue
}
statuses[name] = result