From 8d3569f81a4e368cf3a3df6dc03919375fd73123 Mon Sep 17 00:00:00 2001 From: Parthvi Vala Date: Thu, 1 Sep 2022 22:32:58 +0530 Subject: [PATCH] Fix: (odo list) Empty parenthesis for odo version if component is not running on the cluster Signed-off-by: Parthvi Vala --- pkg/odo/cli/list/component/list.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/odo/cli/list/component/list.go b/pkg/odo/cli/list/component/list.go index 19e5bb90445..c41d11a516e 100644 --- a/pkg/odo/cli/list/component/list.go +++ b/pkg/odo/cli/list/component/list.go @@ -192,18 +192,13 @@ func HumanReadableOutput(list api.ResourcesList) { // If we find our local unpushed component, let's change the output appropriately. if list.ComponentInDevfile == comp.Name { name = fmt.Sprintf("* %s", name) - - if comp.ManagedBy == "" { - managedBy = "odo" - } } - + if comp.ManagedByVersion != "" { + managedBy += fmt.Sprintf(" (%s)", comp.ManagedByVersion) + } // If we are managing that component, output it as blue (our logo colour) to indicate it's used by odo - if managedBy == "odo" { - managedBy = text.Colors{text.FgBlue}.Sprintf("odo (%s)", comp.ManagedByVersion) - } else if managedBy != "" && comp.ManagedByVersion != "" { - // this is done to maintain the color of the output - managedBy += fmt.Sprintf("(%s)", comp.ManagedByVersion) + if comp.ManagedBy == "odo" { + managedBy = text.Colors{text.FgBlue}.Sprintf(managedBy) } t.AppendRow(table.Row{name, componentType, mode, managedBy})