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

Adding filtering for service binding services #5015

Merged
Merged
Show file tree
Hide file tree
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
6 changes: 4 additions & 2 deletions pkg/odo/cli/service/list_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ func (o *ServiceListOptions) listOperatorServices() (err error) {
w := tabwriter.NewWriter(os.Stdout, 5, 2, 3, ' ', tabwriter.TabIndent)
fmt.Fprintln(w, "NAME", "\t", "MANAGED BY ODO", "\t", "STATE", "\t", "AGE")
for _, name := range orderedNames {
managedByOdo, state, duration := getTabularInfo(servicesItems[name], devfileComponent)
fmt.Fprintln(w, name, "\t", managedByOdo, "\t", state, "\t", duration)
if !strings.HasPrefix(name, "ServiceBinding/") {
managedByOdo, state, duration := getTabularInfo(servicesItems[name], devfileComponent)
fmt.Fprintln(w, name, "\t", managedByOdo, "\t", state, "\t", duration)
}
}
w.Flush()

Expand Down
5 changes: 5 additions & 0 deletions tests/integration/operatorhub/cmd_link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ var _ = Describe("odo link command tests for OperatorHub", func() {
Expect(stdOut).To(ContainSubstring("Environment Variables"))
Expect(stdOut).To(ContainSubstring("REDIS_CLUSTERIP"))
})

It("should not list the service binding in `odo service list`", func() {
stdOut := helper.Cmd("odo", "service", "list", "--context", commonVar.Context).ShouldPass().Out()
Expect(stdOut).ToNot(ContainSubstring("ServiceBinding/"))
})
})
})

Expand Down