Bug 1498618

Summary: Bind Parameters not shown in the UI
Product: OpenShift Container Platform Reporter: cchase
Component: Service BrokerAssignee: cchase
Status: CLOSED ERRATA QA Contact: Jian Zhang <jiazha>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.7.0CC: aos-bugs, cchase, jmatthew, wmeng
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 22:15:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description cchase 2017-10-04 19:20:18 UTC
Description of problem:
Bind parameters aren't shown in the UI for APBs.

How reproducible:
100%

Steps to Reproduce:
1. Create an APB image with bind_parameters.  For example:
name: test-bind-params
bindable: True
plans:
  - name: default
    parameters:
      - name: w
        title: w
        type: string
    bind_parameters:
      - name: x
        title: x
        type: string
      - name: y
        title: y
        type: string

2. Load the APB into the service broker
3. Provision APB
4. Start the Create Binding wizard for the provisioned service

Actual results:
During the binding wizard, no parameters are shown.

Expected results:
Bind parameters are listed and taken as inputs during the bind wizard screens.


Additional info:

Comment 1 cchase 2017-10-05 20:00:11 UTC
https://github.com/openshift/ansible-service-broker/pull/467

After the above fix, adding a bind_parameters section to an APB should display the parameters in the create binding wizards.

Comment 2 cchase 2017-10-09 15:21:00 UTC
In 3.6 we treated Provision/Bind parameters as same thing, this was fine in 3.6 since the web-console did not display bind parameters.
In 3.7 the web-console began displaying bind parameters, and the broker was still communicating the provision parameters as also being same for bind.

In 3.7 we fixed the broker to split out the parameters, now bind parameters need to be marked explicitly as bind parameters.
For 3.7 we do not plan to release any official examples with bind parameters in RHCC (as using the bind parameters implies the need for async bind support for APBs which is not present in current Open Service Broker API spec, nor in Service Catalog).

In order to test this BZ please do the following:
 - Verify that during the bind step you do _not_ see a duplicate of provisioning parameters.  We expect the bind step to have no parameters for most of our APBs at the moment.
 - To test bind parameters are able to show up, please use this test APB image docker.io/cfchase/bind-param-apb, note this image is for experimental testing, it is not release with 3.7 and further to trigger the actual bind workflow you need to modify the broker to set "launch_apb_on_bind=true" which is not the default.  (Again due to lack of async bind support, the broker currently defaults to having the bind operation be a look up for credentials generated and cached during provision).

Comment 3 cchase 2017-10-09 17:27:32 UTC
Using the test image, the following parameters will show for provision
- PostgreSQL Admin Password

The following bind parameters will be shown:
- PostgreSQL Database Name
- PostgreSQL User
- PostgreSQL Password

Comment 6 cchase 2017-10-20 21:06:45 UTC
Regarding Issue 1.  

Unfortunately, due to https://bugzilla.redhat.com/show_bug.cgi?id=1502033, after pushing or bootstrapping, Service catalog is not properly updating the plans, so any new parameters would not show.  Hopefully when that bug is fixed, it will show.  However, if you build and push to a docker repo, a fresh instance of the broker would display your new parameters.

Regarding Issue 2.

I haven't been able to reproduce your issue on upstream, but it looks like it's not  provisioning correctly but doesn't look like it has anything to do with bind_parameters.  I'm not sure what would be causing this, but it might be environmental with something downstream.



Since the actual async bind is an experimental feature that's locked away behind a feature flag, I believe it's sufficient to see the bind_parameters (and not the provision parameters) in the bind wizard UI at this time.

Comment 8 cchase 2017-10-27 17:02:12 UTC
Issue 1
By the way, the "async-bind" branch of hello-world-db-apb was what I used to test out the bind parameters if you're looking to test out the binding and don't want to write your own.  It should still be valid. https://github.com/ansibleplaybookbundle/hello-world-db-apb/tree/async-bind

Issue 2
Unfortunately, I still have not been able to reproduce your issue.  The parameters appear for me in both wizards and I'm pretty sure the OpenShift UI developers used it and saw similar results.  It might be something environmental. I don't know if I can replicate your environment that's causing this.  Perhaps if I could get your exact steps, but I'm not sure what else to try.

Comment 10 cchase 2017-10-30 14:05:30 UTC
From the looks of the APB you've pushed in the first portion there are no bind parameters.  Can you verify the "async-bind" branch is checked out before I take this up again?

I'm not sure the state of plans updating and reconciling correctly in service-catalog, but if you push it to your org before deploying the broker, that would avoid the issue.

To use the async-bind version of things with "launch_apb_on_bind: true" you have to have the async-bind branch of hello-world-db-apb 
$ git clone git:ansibleplaybookbundle/hello-world-db-apb.git
$ cd hello-world-db-apb
$ git checkout async-bind

To use a registry, you can do this: 
# use your registry/org here if this is incorrect
$ apb build --tag docker.io/zjianbjz/hello-world-db-apb 
$ docker push docker.io/zjianbjz/hello-world-db-apb

# only if broker is already launched:
$ apb bootstrap

Launching the broker would pick up the correct apb and the bootstrap would not be necessary.



If you do use apb push, the async-bind param should look like this and the bind_parameters should show up:

$ git checkout async-bind 
Switched to branch 'async-bind'

$ apb build
Finished writing dockerfile.
Building APB using tag: [hello-world-db-apb]
Successfully built APB image: hello-world-db-apb

$ apb push
version: 1.0
name: hello-world-db-apb
description: A sample APB which deploys Hello World Database
bindable: True
async: optional
metadata:
  displayName: Hello World Database (APB)
  dependencies: ['docker.io/centos/postgresql-95-centos7']
  providerDisplayName: "Red Hat, Inc."
plans:
  - name: default
    description: A sample APB which deploys Hello World Database
    free: True
    metadata:
      displayName: Default
      longDescription: This plan deploys a Postgres Database the Hello World application can connect to
      cost: $0.00
    parameters:
      - name: postgresql_admin_password
        title: PostgreSQL Admin Password
        type: string
        required: true
    bind_parameters:
      - name: postgresql_db_name
        title: PostgreSQL Database Name
        type: string
        required: true
        default: hello-world
      - name: postgresql_user
        title: PostgreSQL User
        type: string
        required: true
        default: hello-world-user
      - name: postgresql_password
        title: PostgreSQL Password
        type: string
        required: true


As you can see, there are bind_parameters showing as you push.  You can also look at the json and see the bind_parameters in the service_binding part
$ apb list -o json
<cut other json/>
  "name": "default",
  "schemas": {
    "service_binding": {
      "create": {
        "parameters": {
          "$schema": "http://json-schema.org/draft-04/schema",
          "additionalProperties": false,
          "properties": {
            "postgresql_db_name": {
              "default": "hello-world",
              "title": "PostgreSQL Database Name",
              "type": "string"
            },
            "postgresql_password": {
              "title": "PostgreSQL Password",
              "type": "string"
            },
            "postgresql_user": {
              "default": "hello-world-user",
              "title": "PostgreSQL User",
              "type": "string"
            }
          },
          "required": [
            "postgresql_db_name",
            "postgresql_user",
            "postgresql_password"
          ],
          "type": "object"
        }
      }
    }
<cut other json/>

Comment 11 cchase 2017-10-30 14:11:58 UTC
One additional thing that you're probably already doing.  Please reload the web UI after doing a push, relist, or bootstrap operation so that changes are reflected.

Comment 15 errata-xmlrpc 2017-11-28 22:15:02 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/RHSA-2017:3188