Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim env. variable names before passing them to Rancher #71

Open
dimw opened this issue Sep 7, 2021 · 0 comments
Open

Trim env. variable names before passing them to Rancher #71

dimw opened this issue Sep 7, 2021 · 0 comments

Comments

@dimw
Copy link

dimw commented Sep 7, 2021

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.

dimw added a commit to dimw/rancher-gitlab-deploy that referenced this issue Sep 7, 2021
dimw added a commit to dimw/rancher-gitlab-deploy that referenced this issue Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant