Closed JanGutter closed 4 months ago
/kind bug
What steps did you take and what happened:
When creating a credential for OpenStack using the command: source env.rc path/to/clouds.yaml sample
source env.rc path/to/clouds.yaml sample
The command failed with an error: Error: yaml: did not find expected node content
Error: yaml: did not find expected node content
This happened because the password contained a comma.
password
What did you expect to happen:
The credentials to be correctly parsed and converted.
Anything else you would like to add:
This bug was introduced in back in https://github.com/kubernetes-sigs/cluster-api-provider-openstack/commit/4be90a99c588b09046677646819aabc78ce11a56
Example:
This fails: echo "a:" | FOO=",123" ./yq e ".a.b = env(FOO) " - with: Error: yaml: did not find expected node content
echo "a:" | FOO=",123" ./yq e ".a.b = env(FOO) " -
The fix is to use strenv: echo "a:" | FOO=",123" ./yq e ".a.b = strenv(FOO) " - returning:
strenv
echo "a:" | FOO=",123" ./yq e ".a.b = strenv(FOO) " -
a: b: ',123'
Environment:
git rev-parse HEAD
/kind bug
What steps did you take and what happened:
When creating a credential for OpenStack using the command:
source env.rc path/to/clouds.yaml sample
The command failed with an error:
Error: yaml: did not find expected node content
This happened because the
password
contained a comma.What did you expect to happen:
The credentials to be correctly parsed and converted.
Anything else you would like to add:
This bug was introduced in back in https://github.com/kubernetes-sigs/cluster-api-provider-openstack/commit/4be90a99c588b09046677646819aabc78ce11a56
Example:
This fails:
echo "a:" | FOO=",123" ./yq e ".a.b = env(FOO) " -
with:Error: yaml: did not find expected node content
The fix is to use
strenv
:echo "a:" | FOO=",123" ./yq e ".a.b = strenv(FOO) " -
returning:Environment:
git rev-parse HEAD
if manually built): v0.9.0