Bug 1463166

Summary: [PFfBJOsO]Met error like context.platform: Required value, context.namespace: Required value when provisiong
Product: OpenShift Container Platform Reporter: Wenjing Zheng <wzheng>
Component: Service BrokerAssignee: Jim Minter <jminter>
Status: CLOSED NOTABUG QA Contact: DeShuai Ma <dma>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs
Target Milestone: ---   
Target Release: ---   
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-06-20 10:00:34 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 Wenjing Zheng 2017-06-20 09:48:16 UTC
Description of problem:
Met below error when provision template:
context.platform: Required value, context.namespace: Required value

Version-Release number of selected component (if applicable):
openshift v3.6.116
kubernetes v1.6.1+5115d708d7
etcd 3.2.0

How reproducible:
always

Steps to Reproduce:
1.By cluster admin:
Modify master/master-config.yaml , then restart all master
templateServiceBrokerConfig:
  templateNamespaces:
  - openshift
$ systemctl restart atomic-openshift-master
2.Create templateservicebroker-client clusterrole by cluster admin
$oc create -f https://raw.githubusercontent.com/openshift/origin/master/pkg/template/servicebroker/test-scripts/clusterrole.yaml
3.Create a project
4.Add cluster address and change namespace to your namespace in shared.sh, then execute it
5.execute provision.sh

Actual results:
Below error appears;
* About to connect() to XXXXXXX port 8443 (#0)
*   Trying 54.90.227.212...
* Connected to XXXXXX port 8443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* NSS: client certificate not found (nickname not specified)
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*     subject: CN=172.18.3.239
*     start date: Jun 20 03:55:02 2017 GMT
*     expire date: Jun 20 03:55:03 2019 GMT
*     common name: 172.18.3.239
*     issuer: CN=openshift-signer@1497930896
> PUT /brokers/template.openshift.io/v2/service_instances/a71f7ab8-e448-4826-8f05-32a185222dd7 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: XXXXXXXXX
> Accept: */*
> X-Broker-API-Version: 2.9
> Content-Type: application/json
> Authorization: Bearer Pr_SRUKMGsLqAANFtYoai8fwCyW8fY6qwSnQYRXIgWk
> Content-Length: 301
> 
* upload completely sent off: 301 out of 301 bytes
< HTTP/1.1 400 Bad Request
< Cache-Control: no-store
< Content-Type: application/json
< X-Broker-Api-Version: 2.11
< Date: Tue, 20 Jun 2017 09:28:03 GMT
< Content-Length: 93
< 
{
  "description": "[context.platform: Required value, context.namespace: Required value]"
* Connection #0 to host ec2-54-90-227-212.compute-1.amazonaws.com left intact
 }

Expected results:
Should provision successfully

Additional info:

Comment 1 Jim Minter 2017-06-20 10:00:34 UTC
The context field was added late in the development cycle of 3.6 and replaces the previous namespace parameter.

See https://github.com/openshift/origin/blob/b14017547388eca65aa9bcbf858db7b9b8315918/pkg/template/servicebroker/test-scripts/provision.sh#L10-L13 for an example.

Your test scripts need to be updated.