Bug 1649075 - Multiline secrets are not correctly parsed
Summary: Multiline secrets are not correctly parsed
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.1.0
Assignee: Jesus M. Rodriguez
QA Contact: Zhang Cheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-12 21:13 UTC by Jesus M. Rodriguez
Modified: 2019-03-12 14:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-05 19:08:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jesus M. Rodriguez 2018-11-12 21:13:35 UTC
## Bug:

**What happened**:
If you follow https://github.com/openshift/ansible-service-broker/blob/master/docs/secrets.md and try to add a multiline secret as in:
```
---
apiVersion: v1
kind: Secret
metadata:
    name: test
    namespace: openshift-automation-service-broker
stringData:
    "test1": "test1"
    "test2": "test2"
    "test_multiline": |-
      -----BEGIN RSA PRIVATE KEY-----
      <FIRST LINE OF THE SSH KEY>
      <SECOND LINE OF THE SSH KEY>
```
the Ansible Playbook Bundle will see an error while loading the secrets YAML file, as if it was using newlines to separate secrets:
```
ERROR! Syntax Error while loading YAML.
  could not find expected ':'
The error appears to have been in '/tmp/secrets': line 6, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
<FIRST LINE OF THE SSH KEY>
<SECOND LINE OF THE SSH KEY>
^ here
```
This happens as well if you use the base64 data secret.

**What you expected to happen**:

The secret should keep the newlines and be used as a parameter on the APB.

Comment 2 Jesus M. Rodriguez 2019-03-05 19:08:25 UTC
Upstream issue closed.
https://github.com/openshift/ansible-service-broker/issues/1028


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