Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: (odo list) Empty parenthesis for odo version if component is not on the cluster #6078

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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