From 8911143389f197f0e0a8efff53c9568dc263d89f Mon Sep 17 00:00:00 2001 From: Sumit Tembe Date: Sat, 25 Jun 2022 20:44:04 +0530 Subject: [PATCH] Feat: omit service output if there's nothing Signed-off-by: Sumit Tembe --- references/cli/status.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/references/cli/status.go b/references/cli/status.go index cd1562695..d794c7521 100644 --- a/references/cli/status.go +++ b/references/cli/status.go @@ -159,7 +159,6 @@ func printAppStatus(_ context.Context, c client.Client, ioStreams cmdutil.IOStre if err := printWorkflowStatus(c, ioStreams, appName, namespace); err != nil { return err } - cmd.Printf("Services:\n\n") return loopCheckStatus(c, ioStreams, appName, namespace) } @@ -240,6 +239,9 @@ func loopCheckStatus(c client.Client, ioStreams cmdutil.IOStreams, appName strin if err != nil { return err } + if len(remoteApp.Status.Services) > 0 { + ioStreams.Infof("Services:\n\n") + } for _, comp := range remoteApp.Status.Services { compName := comp.Name envStat := ""