-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
multienv
Fails if Env Vars Contain =
(equals) Character
#2351
Comments
Yup, ran into this as well, in my case with values that are base64 encodes, with trailing |
multienv step was originally a json input and we asked to convert it to text, I guess that could be the reason why. var=value makes total sense, I do not see the reason why not support it |
@jamengual Would it be possible to get a quick look at #2354? |
Hi! Any workaround? |
A hacky workaround I came up with is to substitue the
|
Hello, I'm facing similar issue with Env vars added through multienv containing the comma (,) character, the error is the following:
My variables is something like this: VARIABLE_NAME=hello, world, this, is, not, working As the variable "VARIABLE_NAME" value contains comma (,) characters, looks like multienv cannot do the job and create the environment variables correctly. |
) (runatlantis#2354) * Update multienv_step_runner Env Var Parsing Logic * Update multienv_step_runner.go to split only on the first = character * Add affirmative and failing test cases * Run gofmt
Community Note
Overview of the Issue
Env vars added through
multienv
cannot contain the=
character. This seems to be becausemultienv_step_runner.go
splits on all=
characters instead of just the first one, and then validates that the resulting slice has a length of exactly 2.I'm not sure if there's a technical reason for this, but I kind of doubt it given that env vars with
=
characters are permitted via theenv
command. Quoting the values doesn't seem to help.I think fixing this would be as simple as replacing the call to
strings.Split(item, "=")
inmultienv_step_runner.go
withstrings.SplitN(item, "=", 2)
. I'd be happy to put up a PR for this.Reproduction Steps
Try to add an env var through
multienv
in which the value contains=
:Environment details
I checked the code, and the issue still exists in the latest version.
The text was updated successfully, but these errors were encountered: