Feat: omit service output if there's nothing

Signed-off-by: Sumit Tembe <sumit.tembe@outlook.com>
This commit is contained in:
Sumit Tembe
2022-06-25 20:45:07 +05:30
parent 15a56408fc
commit 8911143389
+3 -1
View File
@@ -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 := ""