Skip to content
Permalink
Browse files

Machine output for `odo app list` should be `Kind: List` (#2228)

Machine readable output for ApplicationList Kind should actually just be
`Kind`.
  • Loading branch information...
cdrage authored and openshift-merge-robot committed Oct 7, 2019
1 parent f7c4db3 commit 554f569801f2a2599cc7ba16fac708b8e5f0c58d
Showing with 5 additions and 5 deletions.
  1. +2 −2 docs/dev/machine-output.md
  2. +1 −1 pkg/application/application.go
  3. +2 −2 tests/integration/cmd_app_test.go
@@ -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": [
@@ -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": [
@@ -17,7 +17,7 @@ const (
appNameMaxRetries = 3
appAPIVersion = "odo.openshift.io/v1alpha1"
appKind = "Application"
appList = "ApplicationList"
appList = "List"
)

// List all applications in current project
@@ -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")
@@ -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)

0 comments on commit 554f569

Please sign in to comment.
You can’t perform that action at this time.