From 1ebb64d4d4ae77c57803612f7e0fcccfc712b2d4 Mon Sep 17 00:00:00 2001 From: zhaohuiweixiao Date: Mon, 19 Dec 2022 12:42:31 +0800 Subject: [PATCH] Fix: addon ls comman does not show the componentless application (#5201) Signed-off-by: zhaohuihui Signed-off-by: zhaohuihui --- references/cli/ls.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/references/cli/ls.go b/references/cli/ls.go index 56c090684..400c1fb1b 100644 --- a/references/cli/ls.go +++ b/references/cli/ls.go @@ -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 {