Skip to content

Commit

Permalink
Updating check and adding test
Browse files Browse the repository at this point in the history
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
  • Loading branch information
mohammedzee1000 committed Aug 23, 2021
1 parent f845c33 commit 7398ef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/odo/cli/service/list_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ 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 {
if !strings.Contains(name, "ServiceBinding") {
if !strings.HasPrefix(name, "ServiceBinding/") {
managedByOdo, state, duration := getTabularInfo(servicesItems[name], devfileComponent)
fmt.Fprintln(w, name, "\t", managedByOdo, "\t", state, "\t", duration)
}
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")
Expect(stdOut).ToNot(ContainSubstring("ServiceBinding/"))
})
})
})

Expand Down

0 comments on commit 7398ef9

Please sign in to comment.