kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack

Home Page:https://cluster-api-openstack.sigs.k8s.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

env.rc parses the password variable incorrectly

JanGutter opened this issue · comments

/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 4be90a9

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:

a:
  b: ',123'

Environment:

  • Cluster API Provider OpenStack version (Or git rev-parse HEAD if manually built): v0.9.0