Skip to content

Commit

Permalink
Fix: (odo list) Empty parenthesis for odo version if component is not…
Browse files Browse the repository at this point in the history
… running on the cluster (#6078)

Signed-off-by: Parthvi Vala <[email protected]>

Signed-off-by: Parthvi Vala <[email protected]>
  • Loading branch information
valaparthvi authored Sep 6, 2022
1 parent 9e39df3 commit 9c31488
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions pkg/odo/cli/list/component/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 9c31488

Please sign in to comment.