Bug 1470860

Summary: Ansible Service Broker: Do not create a project if it does not exist.
Product: OpenShift Container Platform Reporter: John Matthews <jmatthew>
Component: Service BrokerAssignee: Erik Nelson <ernelson>
Status: CLOSED ERRATA QA Contact: weiwei jiang <wjiang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: aos-bugs, ernelson, wjiang
Target Milestone: ---Keywords: TestCaseNeeded
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 22:01:28 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 John Matthews 2017-07-13 20:49:19 UTC
Description of problem:

The Ansible Service Broker should __not__ create a project if it does not exist.

We want to return a clear error message that the request is failing because project does not exist.

Comment 3 weiwei jiang 2017-07-25 03:16:54 UTC
Checked with:
#asbd --version
0.9.9

and project not existed will not be created, and come out error message in ansible-service-broker pod logs.

The ansible-service-broker pod log is:
[2017-07-25T03:07:31.295Z] [INFO] ASYNC provisioning in progress
[2017-07-25T03:07:31.296Z] [NOTICE] ============================================================
[2017-07-25T03:07:31.296Z] [NOTICE]                        PROVISIONING                         
[2017-07-25T03:07:31.296Z] [NOTICE] ============================================================
[2017-07-25T03:07:31.296Z] [NOTICE] Spec.Id: e1bcd4a8-ce02-4585-9f4c-18abd56d76f2
[2017-07-25T03:07:31.296Z] [NOTICE] Spec.Name: postgresql-apb
[2017-07-25T03:07:31.296Z] [NOTICE] Spec.Image: openshift3/postgresql-apb
[2017-07-25T03:07:31.296Z] [NOTICE] Spec.Description: SCL PostgreSQL apb implementation
[2017-07-25T03:07:31.296Z] [NOTICE] ============================================================
[2017-07-25T03:07:31.296Z] [INFO] Checking if project psql-project exists...
10.128.0.1 - - [25/Jul/2017:03:07:31 +0000] "PUT /v2/service_instances/1554c27c-6073-4dff-9fd8-0e4509e11413?accepts_incomplete=true HTTP/1.1" 202 58
[2017-07-25T03:07:31.573Z] [INFO] Container not up yet, retrying 64 of 150 on pod apb-c1ffa138-8c39-4f97-9ca5-94ee9a39e63f
[2017-07-25T03:07:31.658Z] [ERROR] Project psql-project does NOT exist! Cannot provision requested postgresql-apb
[2017-07-25T03:07:31.658Z] [ERROR] broker::Provision error occurred.
[2017-07-25T03:07:31.658Z] [ERROR] Project psql-project does not exist




The request script is:
#!/bin/bash -e

instanceUUID="1554c27c-6073-4dff-9fd8-0e4509e11413"
planUUID="4c10ff42-be89-420a-9bab-27a9bef9aed8"
serviceUUID="e1bcd4a8-ce02-4585-9f4c-18abd56d76f2"

req="{
  \"plan_id\": \"$planUUID\",
  \"service_id\": \"$serviceUUID\",
  \"context\": {
    \"platform\": \"openshift\",
    \"namespace\": \"psql-project\"
  },
  \"parameters\": {
    \"postgresql_database\": \"admin\",
    \"postgresql_password\": \"admin123\",
    \"postgresql_user\": \"admin\",
    \"postgresql_version\": \"9.5\"
  }
}"

curl \
  -X PUT \
  -H 'X-Broker-API-Version: 2.9' \
  -H 'Content-Type: application/json' \
  -d "$req" \
  -v \
  "http://asb-1338-openshift-ansible-service-broker.0725-di6.qe.rhcloud.com/v2/service_instances/$instanceUUID"

Comment 8 errata-xmlrpc 2017-11-28 22:01:28 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

Comment 9 Red Hat Bugzilla 2023-09-14 04:01:07 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days