From 17c32b6480a650157909c1e7a2322c94e791012e Mon Sep 17 00:00:00 2001 From: kacpernajda Date: Fri, 11 Sep 2026 01:54:20 +0200 Subject: [PATCH] fix: external ArgoCD app list always shows empty sync/health status BuildK8sObjectListTableData in common-lib lower-cases the Table column names when it builds the row maps (keys become "sync status" / "health status"), but getApplicationListDtos looked the values up with the printer-column constants "Sync Status" / "Health Status". The lookup never matched, so the ArgoCD Apps list rendered "-" for every external Argo application even though the Kubernetes Table API returned Synced/Healthy. Lower-case the lookup keys to match what the row builder produces. Signed-off-by: kacpernajda --- pkg/argoApplication/ArgoApplicationService.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/argoApplication/ArgoApplicationService.go b/pkg/argoApplication/ArgoApplicationService.go index 48cd31c56d..0f6638708f 100644 --- a/pkg/argoApplication/ArgoApplicationService.go +++ b/pkg/argoApplication/ArgoApplicationService.go @@ -39,6 +39,7 @@ import ( "go.uber.org/zap" "k8s.io/apimachinery/pkg/api/errors" "net/http" + "strings" ) type ArgoApplicationService interface { @@ -160,6 +161,11 @@ func (impl *ArgoApplicationServiceImpl) ListApplications(clusterIds []int) ([]*b func getApplicationListDtos(resp *k8s.ClusterResourceListMap, clusterName string, clusterId int) []*bean.ArgoApplicationListDto { appLists := make([]*bean.ArgoApplicationListDto, 0) + // BuildK8sObjectListTableData (common-lib) lower-cases the Table column names when it builds the + // row maps, so the keys are "sync status" / "health status", not the "Sync Status" / "Health Status" + // printer-column names. Lower-case the lookup keys too, otherwise both statuses are always empty. + syncStatusKey := strings.ToLower(k8sCommonBean.K8sResourceColumnDefinitionSyncStatus) + healthStatusKey := strings.ToLower(k8sCommonBean.K8sResourceColumnDefinitionHealthStatus) if resp != nil { appLists = make([]*bean.ArgoApplicationListDto, len(resp.Data)) for i, rowData := range resp.Data { @@ -175,13 +181,13 @@ func getApplicationListDtos(resp *k8s.ClusterResourceListMap, clusterName string appListDto.Name = nameStr } } - if rowData[k8sCommonBean.K8sResourceColumnDefinitionSyncStatus] != nil { - if syncStatusStr, ok := rowData[k8sCommonBean.K8sResourceColumnDefinitionSyncStatus].(string); ok { + if rowData[syncStatusKey] != nil { + if syncStatusStr, ok := rowData[syncStatusKey].(string); ok { appListDto.SyncStatus = syncStatusStr } } - if rowData[k8sCommonBean.K8sResourceColumnDefinitionHealthStatus] != nil { - if healthStatusStr, ok := rowData[k8sCommonBean.K8sResourceColumnDefinitionHealthStatus].(string); ok { + if rowData[healthStatusKey] != nil { + if healthStatusStr, ok := rowData[healthStatusKey].(string); ok { appListDto.HealthStatus = healthStatusStr } }