Bug 1463503 - [PFfBJOsO]Object cannot be return per bind request if contain "." in name
Summary: [PFfBJOsO]Object cannot be return per bind request if contain "." in name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Jim Minter
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-21 07:06 UTC by Wenjing Zheng
Modified: 2017-08-16 19:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-08-14 18:46:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wenjing Zheng 2017-06-21 07:06:54 UTC
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:
always

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 08:31:41 UTC
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 12:30:27 UTC
I think documenting the need to escape special characters is a fine resolution.

Comment 5 Wenjing Zheng 2017-06-28 07:08:19 UTC
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.