Bug 1523252 - [APB] Should add more directions for the "--broker" argument of the apb tool
Summary: [APB] Should add more directions for the "--broker" argument of the apb tool
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.8.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.9.0
Assignee: Dylan Murray
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-07 14:20 UTC by Jian Zhang
Modified: 2018-12-13 19:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-12-13 19:26:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3748 0 None None None 2018-12-13 19:26:58 UTC

Comment 4 Jian Zhang 2018-01-25 07:51:26 UTC
The apb tool version:
[root@localhost mediawiki-apb]# rpm -qa | grep apb
apb-1.1.5-1.20180117190645.el7.centos.noarch

Followed the above step 1-5, and then run the "apb list" command.

At present, the user do NOT need to specify the "--broker" argument, very cool! Like below:
[root@localhost mediawiki-apb]# apb list
Didn't find OpenShift Ansible Broker route in namespace: ansible-service-broker.                    Trying openshift-ansible-service-broker
Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog
ID                                NAME               DESCRIPTION                        
2c259ddd8059b9bc65081e07bf20058f  rh-mariadb-apb     Mariadb apb implementation         
03b69500305d9859bb9440d9f9023784  rh-mediawiki-apb   Mediawiki123 apb implementation    
73ead67495322cc462794387fa9884f5  rh-mysql-apb       Software Collections MySQL APB     
d5915e05b253df421efe6e41fb6a66ba  rh-postgresql-apb  SCL PostgreSQL apb implementation 

Furthur more, I still test the "--broker" argument, like below:

[root@localhost mediawiki-apb]# apb list --broker asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com
Contacting the ansible-service-broker at: asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog
ERROR: Failed broker request (get) asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog
Exception occurred! Invalid URL 'asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog': No schema supplied. Perhaps you meant http://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog?

I think the above help info is not so nice. If users followed the help info, they will got errors, like below:
[root@localhost mediawiki-apb]# apb list --broker https://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog
Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog/ansible-service-broker/v2/catalog
Error: Attempt to list APBs in the broker returned status: 404
Unable to list APBs in Ansible Service Broker.

So, I wonder if we can remove the `--broker` item from the "apb list" command.

Comment 6 Dylan Murray 2018-01-31 14:42:11 UTC
Jian,

Your last test after not providing the schema it would have worked if you did:

apb list --broker https://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com

Adding the suffix will cause this to fail as you can see it appends the suffix twice:

[root@localhost mediawiki-apb]# apb list --broker https://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog

Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0125-bk7.qe.rhcloud.com/ansible-service-broker/v2/catalog/ansible-service-broker/v2/catalog

We would prefer to keep the --broker argument in because customers using the AWS service broker will require this flag to use the tooling. For this bug please just confirm that `apb list` succeeds in finding the proper route in a downstream environment.

I would consider your test a success.

Comment 7 Jian Zhang 2018-02-01 02:54:26 UTC
Dylan,

Thanks your clarify! I knew added the suffix will cause faile. I just simulate the user's behaviors after they followed the prompt information. Like:

I specify the route without adding the "https://" prefix.
[root@localhost postgresql-apb]# apb list --broker asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com

Contacting the ansible-service-broker at: asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com/ansible-service-broker/v2/catalog
ERROR: Failed broker request (get) asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com/ansible-service-broker/v2/catalog
Exception occurred! Invalid URL 'asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com/ansible-service-broker/v2/catalog': No schema supplied. Perhaps you meant http://asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com/ansible-service-broker/v2/catalog?

I mean remove the "No schema supplied. Perhaps you meant http://asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com/ansible-service-broker/v2/catalog?" sentence form the prompt information will be better.

Or change it to "No schema supplied. Perhaps you meant https://asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com/ansible-service-broker?" How do you think?

Comment 8 Dylan Murray 2018-02-01 19:51:54 UTC
https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/pull/220

So after some thinking I decided that we should be attempting to prepend the schema if no schema is provided. This way `apb list --broker <route_with_no_schema>` succeeds.

Please retest after this is merged with:

apb list --broker asb-1338-openshift-ansible-service-broker.apps.0131-r4p.qe.rhcloud.com

Comment 9 Dylan Murray 2018-02-05 14:47:12 UTC
This was built on 2/2. Latest release should resolve this.

Comment 10 Jian Zhang 2018-02-08 03:18:37 UTC
Dylan,

Yes, below are the details:
The apb tool version: 1.1.7
[root@localhost postgresql-apb]# apb version
Version: apb-1.1.7

1, Enable the developer mode of the ASB and log in the cluster.
2, Execute the `apb list` without the `--broker` argument.
[root@localhost postgresql-apb]# apb list
Didn't find OpenShift Ansible Broker route in namespace: ansible-service-broker.                    Trying openshift-ansible-service-broker
Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0208-x5n.qe.rhcloud.com/ansible-service-broker/v2/catalog
ID                                NAME                   DESCRIPTION                                               
3b18d5937f0cbb99ee6693993a525be7  dh-fail-apb            This is an APB built to fail on provision or deprovision  
0a8f417c71d090c39dc2ba73f538c148  dh-hello-test-apb      deploys hello-test web application                        
b43a4272a6efcaaa3e0b9616324f1099  dh-hello-world-db-apb  A sample APB which deploys Hello World Database           
f6c4486b7fb0cdac4b58e193607f7011  dh-mediawiki-apb       Mediawiki apb implementation 

3,Execute it with the `broker` argument.

[root@localhost postgresql-apb]# apb list --broker asb-1338-openshift-ansible-service-broker.apps.0208-x5n.qe.rhcloud.com
Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0208-x5n.qe.rhcloud.com/ansible-service-broker/v2/catalog
ID                                NAME                   DESCRIPTION                                               
3b18d5937f0cbb99ee6693993a525be7  dh-fail-apb            This is an APB built to fail on provision or deprovision  
0a8f417c71d090c39dc2ba73f538c148  dh-hello-test-apb      deploys hello-test web application                        
b43a4272a6efcaaa3e0b9616324f1099  dh-hello-world-db-apb  A sample APB which deploys Hello World Database           
f6c4486b7fb0cdac4b58e193607f7011  dh-mediawiki-apb       Mediawiki apb implementation 

With the 'https' prefix.
[root@localhost postgresql-apb]# apb list --broker https://asb-1338-openshift-ansible-service-broker.apps.0208-x5n.qe.rhcloud.com
Contacting the ansible-service-broker at: https://asb-1338-openshift-ansible-service-broker.apps.0208-x5n.qe.rhcloud.com/ansible-service-broker/v2/catalog
ID                                NAME                   DESCRIPTION                                               
3b18d5937f0cbb99ee6693993a525be7  dh-fail-apb            This is an APB built to fail on provision or deprovision  
0a8f417c71d090c39dc2ba73f538c148  dh-hello-test-apb      deploys hello-test web application                        
b43a4272a6efcaaa3e0b9616324f1099  dh-hello-world-db-apb  A sample APB which deploys Hello World Database           
f6c4486b7fb0cdac4b58e193607f7011  dh-mediawiki-apb       Mediawiki apb implementation 

So, it looks good to me.

Comment 13 errata-xmlrpc 2018-12-13 19:26:48 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:3748


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