Bug 1463503 - [PFfBJOsO]Object cannot be return per bind request if contain "." in name
[PFfBJOsO]Object cannot be return per bind request if contain "." in name
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker (Show other bugs)
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Jim Minter
DeShuai Ma
Depends On:
  Show dependency treegraph
Reported: 2017-06-21 03:06 EDT by Wenjing Zheng
Modified: 2017-08-16 15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-08-14 14:46:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Wenjing Zheng 2017-06-21 03:06:54 EDT
Description of problem:
Cannot recognize object name which contain "." per bind request:
  "description": "FindResults failed on annotation template.openshift.io/expose-special.how: special is not found"

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

How reproducible:

Steps to Reproduce:
1.Create a configmap template under test project like below:
"apiVersion": "v1",
                "kind": "ConfigMap",
                "metadata": {
                        "name": "special-config",
                        "annotations": {
                          "template.openshift.io/expose-how": "{.data['special.how']}",
                          "template.openshift.io/expose-type": "{.data['special.type']}"
                "data": {
                        "special.how": "${DATA_1}",
                        "special.type": "${DATA_2}"
2. Enable service broker to project test
3. Change namespace and cluster address in shared.shh
4. Change namespace to test in provision.sh and bind.ssh and execute these two scripts

Actual results:
  "description": "FindResults failed on annotation template.openshift.io/expose-special.how: special is not found"

Expected results:
Should return output like below:
"credentials": {
   "special.how": "data1-SJ6",
   "special.type": "data2-K4E"

Additional info:
Comment 2 Jim Minter 2017-06-21 04:31:41 EDT
Good find.

Perhaps I should have evaluated the kubernetes jsonpath implementation more closely before using it - this is a second example of the implementation being a bit shaky.

It's not documented upstream, but it looks intended that you can work around this issue by escaping the '.' character as follows:

"template.openshift.io/expose-how": "{.data['special\\.how']}",

I worry that there'll be no appetite for changing this behaviour upstream; I'm inclined to resolve this bz by adding a note to the documentation.  @bparees, what do you think?
Comment 3 Ben Parees 2017-06-21 08:30:27 EDT
I think documenting the need to escape special characters is a fine resolution.
Comment 5 Wenjing Zheng 2017-06-28 03:08:19 EDT
Verified this bug since this is added as a documentation to avoid using special characters.

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