Bug 1577769 - [APB] apb list "-o" option output format in yaml and json have different result
Summary: [APB] apb list "-o" option output format in yaml and json have different result
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.10.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.11.0
Assignee: Dylan Murray
QA Contact: Zihan Tang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-14 06:45 UTC by sunzhaohua
Modified: 2018-10-11 07:20 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-10-11 07:20:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 0 None None None 2018-10-11 07:20:21 UTC

Description sunzhaohua 2018-05-14 06:45:02 UTC
Description of problem:
`apb list -o yaml` and `apb list -o json` have different results. If this option must use with "--verbose" option should be explained. If add --verbose option, the result also different.


Version-Release number of selected component (if applicable):
oc v3.10.0-0.41.0
Version: apb-1.2.8

How reproducible:
Always

Steps to Reproduce:
1. list all apbs
#apb list
2. Output verbose information in yaml or json
#apb list -o yaml
#apb list -o json
3. add "--verbose" option
#apb list -o yaml --verbose
#apb list -o json --verbose

Actual results:
Output verbose information in yaml or json are different. 
Add "--verbose" option, yaml lack of "instances_retrievable", "instances_retrievable", "plans.id", "plans.schemas".

1. # apb list
ID                                NAME             DESCRIPTION                                         
0cd794ef27f565cc0e755585dbbcdcdc  local-my-01-apb  This is a sample application generated by apb init

2. # apb list -o yaml
ID                                NAME             DESCRIPTION                                         
0cd794ef27f565cc0e755585dbbcdcdc  local-my-01-apb  This is a sample application generated by apb init 

# apb list -o json
[
    {
        "bindable": false, 
        "bindings_retrievable": false, 
        "description": "This is a sample application generated by apb init", 
        "id": "0cd794ef27f565cc0e755585dbbcdcdc", 
        "instances_retrievable": true, 
        "metadata": {
            "dependencies": [], 
            "displayName": "my-01"
        }, 
        "name": "local-my-01-apb", 
        "plans": [
            {
                "description": "This default plan deploys my-01-apb", 
                "free": true, 
                "id": "92111c30af3ec77c9c6bbfb3fa02990c", 
                "metadata": {
                    "schemas": {
                        "service_binding": {
                            "create": {
                                "openshift_form_definition": []
                            }
                        }, 
                        "service_instance": {
                            "create": {
                                "openshift_form_definition": []
                            }, 
                            "update": {}
                        }
                    }
                }, 
                "name": "default", 
                "schemas": {
                    "service_binding": {
                        "create": {
                            "parameters": {
                                "$schema": "http://json-schema.org/draft-04/schema", 
                                "additionalProperties": false, 
                                "type": "object"
                            }
                        }
                    }, 
                    "service_instance": {
                        "create": {
                            "parameters": {
                                "$schema": "http://json-schema.org/draft-04/schema", 
                                "additionalProperties": false, 
                                "type": "object"
                            }
                        }, 
                        "update": {
                            "parameters": {
                                "$schema": "http://json-schema.org/draft-04/schema", 
                                "additionalProperties": false, 
                                "type": "object"
                            }
                        }
                    }
                }
            }
        ]
    }
]

3. # apb list -o json --verbose
same with `apb list -o json`

# apb list -o yaml --verbose
name: local-my-01-apb
id: 0cd794ef27f565cc0e755585dbbcdcdc
description: This is a sample application generated by apb init
bindable: false
metadata:
  dependencies: []
  displayName: my-01
plans:
- name: default
  description: This default plan deploys my-01-apb
  free: true
  metadata:
    schemas:
      service_binding:
        create:
          openshift_form_definition: []
      service_instance:
        create:
          openshift_form_definition: []
        update: {}
  parameters: []
  bind_parameters: []
  
  

Expected results:
Output information in yaml or json are same.
1) `apb list -o yaml` and `apb list -o json` should all show brief information.
2)`apb list -o yaml --verbose` and `apb list -o json --verbose` should have same detail information.


Additional info:

Comment 1 Dylan Murray 2018-08-13 19:06:59 UTC
https://github.com/automationbroker/apb/pull/114

The equivalent command is now `apb broker catalog`. You can do `apb broker catalog -o yaml` or `apb broker catalog -o json` and see the services displayed in either format. By default it uses a custom table printer and hides excessive information.

Comment 2 Dylan Murray 2018-08-22 14:50:21 UTC
New builds added to advisory:
openshift-enterprise-asb-container-v3.11.0-0.20.0.0
openshift-enterprise-apb-tools-container-v3.11.0-0.20.0.0

Comment 3 Zihan Tang 2018-08-28 08:38:34 UTC
Verified. 
-o json or -o yaml worked for 'apb broker catalog' 

version: apb-1.9.3

Comment 5 errata-xmlrpc 2018-10-11 07:20:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2652


Note You need to log in before you can comment on or make changes to this bug.