Skip to content

Commit

Permalink
Machine output for odo app list should be Kind: List
Browse files Browse the repository at this point in the history
Machine readable output for ApplicationList Kind should actually just be
`Kind`.
  • Loading branch information
cdrage committed Oct 2, 2019
1 parent 188b7ba commit 6ef5784
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/machine-output.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This document outlines all the machine readable output options and examples.

```json
{
"kind": "ApplicationList",
"kind": "List",
"apiVersion": "odo.openshift.io/v1alpha1",
"metadata": {},
"items": [
Expand Down Expand Up @@ -55,7 +55,7 @@ This document outlines all the machine readable output options and examples.

```json
{
"kind": "ApplicationList",
"kind": "List",
"apiVersion": "odo.openshift.io/v1alpha1",
"metadata": {},
"items": [
Expand Down
2 changes: 1 addition & 1 deletion pkg/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
appNameMaxRetries = 3
appAPIVersion = "odo.openshift.io/v1alpha1"
appKind = "Application"
appList = "ApplicationList"
appList = "List"
)

// List all applications in current project
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/cmd_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("odo app command tests", func() {
appList := helper.CmdShouldPass("odo", "app", "list", "--project", project)
Expect(appList).To(ContainSubstring("There are no applications deployed"))
actual := helper.CmdShouldPass("odo", "app", "list", "-o", "json", "--project", project)
desired := `{"kind":"ApplicationList","apiVersion":"odo.openshift.io/v1alpha1","metadata":{},"items":[]}`
desired := `{"kind":"List","apiVersion":"odo.openshift.io/v1alpha1","metadata":{},"items":[]}`
Expect(desired).Should(MatchJSON(actual))

appDelete := helper.CmdShouldFail("odo", "app", "delete", "test", "--project", project, "-f")
Expand Down Expand Up @@ -118,7 +118,7 @@ var _ = Describe("odo app command tests", func() {
Expect(appListOutput).To(ContainSubstring(appName))
actualCompListJSON := helper.CmdShouldPass("odo", "app", "list", "-o", "json", "--project", project)
//desiredCompListJSON := `{"kind":"List","apiVersion":"odo.openshift.io/v1alpha1","metadata":{},"items":[]}`
desiredCompListJSON := fmt.Sprintf(`{"kind":"ApplicationList","apiVersion":"odo.openshift.io/v1alpha1","metadata":{},"items":[{"kind":"Application","apiVersion":"odo.openshift.io/v1alpha1","metadata":{"name":"app","namespace":"%s","creationTimestamp":null},"spec":{"components":["%s"]}}]}`, project, cmpName)
desiredCompListJSON := fmt.Sprintf(`{"kind":"List","apiVersion":"odo.openshift.io/v1alpha1","metadata":{},"items":[{"kind":"Application","apiVersion":"odo.openshift.io/v1alpha1","metadata":{"name":"app","namespace":"%s","creationTimestamp":null},"spec":{"components":["%s"]}}]}`, project, cmpName)
Expect(desiredCompListJSON).Should(MatchJSON(actualCompListJSON))

helper.CmdShouldPass("odo", "app", "describe", appName, "--project", project)
Expand Down

0 comments on commit 6ef5784

Please sign in to comment.