Skip to content

Commit

Permalink
having no components in an app shouldn't be an error (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
girishramnani authored and openshift-merge-robot committed Jul 19, 2019
1 parent 424a9eb commit 724a139
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions pkg/odo/cli/application/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/openshift/odo/pkg/application"
"github.com/openshift/odo/pkg/component"
"github.com/openshift/odo/pkg/log"
"github.com/openshift/odo/pkg/odo/cli/project"
"github.com/openshift/odo/pkg/odo/genericclioptions"
"github.com/openshift/odo/pkg/odo/util"
Expand Down Expand Up @@ -82,7 +81,7 @@ func (o *DescribeOptions) Run() (err error) {
serviceList, _ := service.ListWithDetailedStatus(o.Client, o.appName)

if len(componentList.Items) == 0 && len(serviceList) == 0 {
log.Errorf("Application %s has no components or services deployed.", o.appName)
fmt.Printf("Application %s has no components or services deployed.", o.appName)
} else {
fmt.Printf("Application Name: %s has %v component(s) and %v service(s):\n--------------------------------------\n",
o.appName, len(componentList.Items), len(serviceList))
Expand Down
5 changes: 2 additions & 3 deletions tests/integration/cmd_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ var _ = Describe("odoCmdApp", func() {

appDelete := helper.CmdShouldFail("odo", "app", "delete", "test", "--project", project, "-f")
Expect(appDelete).To(ContainSubstring("test app does not exists"))
helper.CmdShouldPass("odo", "app", "describe", "test", "--project", project)
// Uncomment once https://github.com/openshift/odo/issues/1803 is fixed
// Expect(appDescribe).To(ContainSubstring("Application test has no components or services deployed."))
appDescribe := helper.CmdShouldPass("odo", "app", "describe", "test", "--project", project)
Expect(appDescribe).To(ContainSubstring("Application test has no components or services deployed."))
})
})

Expand Down

0 comments on commit 724a139

Please sign in to comment.