-
Notifications
You must be signed in to change notification settings - Fork 516
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
Unpack the string values from the CL2_.* envs #1145
Conversation
Without doing it, it's impossible to easily override boolean param via env. E.g. if I do ``` --env=ENABLE_MY_FEATURE=false ``` The `false` will be treated as string and then in the config file the if statement like this: ``` {{if .ENABLE_MY_FEATURE}} ... {{end}} ``` Will evaluate to true and will be executed, because "false" is non-empty string that evaluates to true :)
@@ -240,11 +241,24 @@ func LoadCL2Envs() (map[string]interface{}, error) { | |||
return nil, goerrors.Errorf("unparsable string in os.Eviron(): %v", keyValue) | |||
} | |||
key, value := split[0], split[1] | |||
mapping[key] = value | |||
mapping[key] = unpackStringValue(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure it won't break any existing test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 99% sure as of now.
Currently, we only use this feature in two places: scheduler_throughput and access_tokens. Both are enabled in the presubmit so we'll know for 100% in ~30min
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mm4tt, wojtek-t The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Without doing it, it's impossible to easily override boolean param via env. E.g. if I do
The 'false' will be treated as string, and then in the config file the if statement like this:
Will evaluate to true and will be executed, because "false" is non-empty string that evaluates to true :)