-
Notifications
You must be signed in to change notification settings - Fork 490
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
apply env to array elements #350
apply env to array elements #350
Conversation
@jonseymour Thanks for the PR, I know I don't have any tests around config parsing, but could you add a test that demonstrates the new behavior? Don't worry about testing everything else just the changes. We will get to the other tests in time. |
Ok, I'll add tests. I'll have to abstract the call to os.GetEnv() to allow tests to mock this call, as required. |
8f2928b
to
0e18d04
Compare
@nathanielc I've extended a test and done a more complete reorganisation to simplify the structure of the applyEnvOverrides function. |
Actually, I missed an additional simplifcation that is now possible. I'll re-roll. |
…lements The refactor splits the handling of structs into a separate function and adds a possibly empty fieldDesc parameter to applyEnvOverrides to allow applyEnvOverrides to handle simple values as well as structs. Signed-off-by: Jon Seymour <[email protected]>
2nd parent of merge, merges cleanly with v0.10 branch.
0e18d04
to
c92aa78
Compare
@jonseymour Just to make sure, you made that last simplification correct? Also can you add a changelog entry? Otherwise this looks good to go. Thanks! |
Signed-off-by: Jon Seymour <[email protected]>
Yes, simplifications complete. Changelog now updated. |
Nice, this should remove sed magic from my Docker image, thanks! |
…ements apply env to array elements
This fixes #348.
In particular:
KAPACITOR_INFLUXDB_0_URLS_0=http://localhost:9000 kapacitord config
should now produce a config which does the expected thing.