Fix: addon ls comman does not show the componentless application (#5201)

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
This commit is contained in:
zhaohuiweixiao
2022-12-19 12:42:31 +08:00
committed by GitHub
parent e6fe7eb7d3
commit 1ebb64d4d4
+9
View File
@@ -134,6 +134,15 @@ func buildApplicationListTable(ctx context.Context, c client.Reader, namespace s
service[s.Name] = s
}
if len(a.Spec.Components) == 0 {
if AllNamespace {
table.AddRow(a.Namespace, a.Name, "", "", "", a.Status.Phase, "", "", a.CreationTimestamp)
} else {
table.AddRow(a.Name, "", "", "", a.Status.Phase, "", "", a.CreationTimestamp)
}
continue
}
for idx, cmp := range a.Spec.Components {
var appName = a.Name
if idx > 0 {