rancher-gitlab-deploy
rancher-gitlab-deploy copied to clipboard
Trim env. variable names before passing them to Rancher
Actual behaviour:
When passing multiple variables alongside with the --variables
multiline configuration might be used:
deploy:
stage: deploy
image: cdrx/rancher-gitlab-deploy
script:
- >
upgrade
--variables "
DB_HOST=db.example.com,
DB_USER=foo,
DB_PASSWORD=bar
"
Which result in the following command after YAML is processed:
upgrade --variables " DB_HOST=db.example.com, DB_USER=foo, DB_PASSWORD=bar"
Due to the current string splitting logic, the spaces before the env variables become a part of the variable passed to Rancher (1.6.30) which result in an invalid env variable which appears in the Rancher UI (e.g. <space>DB_HOST
, incl. the space) but is not passed to the container.
Expected outcome:
Variable names and values are trimmed when passing as string with --variables
option.