-
Notifications
You must be signed in to change notification settings - Fork 315
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
[hab-director] per-service environment variables #1075
Conversation
@metadave, thanks for your PR! By analyzing the annotation information on this pull request, we identified @adamhjk, @davidwrede, @leonhartX and @fnichol to be potential reviewers |
1a8ddc5
to
c1c62ab
Compare
@@ -98,23 +99,61 @@ impl Config { | |||
fn lookup_service_param(toml: &toml::Value, | |||
service_name: &str, | |||
param_name: &str) | |||
-> Option<String> { | |||
-> Result<Option<String>> { |
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.
This funciton never returns an Err
case so just using Option
is fine here
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.
right, I gave it the same return type as the new function I added for consistency.
On Jul 18, 2016, at 1:33 PM, Jamie Winsor [email protected] wrote:
In components/director/src/config.rs:
@@ -98,23 +99,61 @@ impl Config {
fn lookup_service_param(toml: &toml::Value,
service_name: &str,
param_name: &str)
-> Option<String> {
This funciton never returns an Err case so just using Option is fine here-> Result<Option<String>> {
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
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.
ok, lookup_service_param()
has been updated to only accept string types, which makes the Result<Option<String>>
the correct return type.
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.
Perfect!
@metadave one minor comment but everything else looks like a great addition. Thanks for updating the docs! |
allow director service defs to specify a child "env" table Signed-off-by: Dave Parfitt <[email protected]>
18fc8f8
to
a3b0f7a
Compare
|
||
[services.core.rngd.foo.someorg] | ||
start = "--permanent-peer --foo=bar" | ||
JAVA_HOME="/a/different/path/" |
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.
Shouldn't this be under a .env
key?
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.
fixed!
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.
er, will push in a different PR
I think this is probably a good addition, but we still have some work to do with handling environment variables. This solution only works for the director, at runtime, with totally static data. If I need to set, say something like The situations I can think of that we should be able to handle are:
You can do both of these pretty easily right now if you specify a run hook, but it might be nicer to have something available that you can use if you're just doing These are just considerations for building the features out. Your PR is fine and we can flesh out the other pieces later. Thanks! |
Services can provide environment variables in the form of a TOML table which follows the following format:
For example:
for you @smith 🍰