-
Notifications
You must be signed in to change notification settings - Fork 2k
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
artifact: enable inheriting environment variables from client #15514
Conversation
e2b5d8a
to
be57726
Compare
This PR adds client configuration for specifying environment variables that should be inherited by the artifact sandbox process from the Nomad Client agent. Most users should not need to set these values but the configuration is provided to ensure backwards compatability. Configuration of go-getter should ideally be done through the artifact block in a jobspec task. e.g. ```hcl client { artifact { set_environment_variables = "TMPDIR,GIT_SSH_OPTS" } } ``` Closes #15498
be57726
to
96608ce
Compare
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.
LGTM! I can bikeshed the name but I'm happy with it as-is as well 😀
// SetEnvironmentVariables is a comma-separated list of environment | ||
// variable names to inherit from the Nomad Client and set in the artifact | ||
// download sandbox process. | ||
SetEnvironmentVariables *string `hcl:"set_environment_variables"` |
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.
On the name "set": is there future in which we might want to let users set specific env vars, rather than having them inherit from the client?
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 think we can continue using this field to support setting custom values, just by interpreting '=' as key+value, e.g.
set_environment_variables = "BLAH,PATH=/opt/custom/bin"
But that would be beyond compatibility support, so that's a PR for another day
- `set_environment_variables` `(string:"")` - Specifies a comma separated list | ||
of environment variables that should be inherited by the artifact sandbox from | ||
the Nomad client's environment. |
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.
Do we want to call out the default variables here so that people don't think they need to add PATH
?
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR adds client configuration for specifying environment variables that
should be inherited by the artifact sandbox process from the Nomad Client agent.
Most users should not need to set these values but the configuration is provided
to ensure backwards compatability. Configuration of go-getter should ideally be
done through the artifact block in a jobspec task.
e.g.
Closes #15497