-
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
Support for loading from a directory tree where each file represents one setting #94
base: master
Are you sure you want to change the base?
Conversation
…ways look in the order of AddConfigPath IntelliJ reformat code simplify cascade lookup
Actually this should use discovery instead of reading from a given directory. Instead of
|
What use case does this satisfy? |
We're looking for this because of the way kubernetes handles secret distribution. Basically it mounts a volume into the container with the secrets exposed as files. |
Sounds good. There is an in-progress PR for supporting cascading config files, it might be good to coordinate the two though I am not sure yet how (and if ) it would make sense to combine them. |
Support for cascading configs will be great, especially since it means we could use kubernetes volumes for secrets, and JSON/YAML for other config. I'll take a look at that diff and see how the two might interact. |
If we can marry these two together I think we’ve got an extremely powerful and useful tool. Just need to be mindful of how this interacts with nesting. |
I've merged the changes from wrobbins cascading configs branch. I'd like to take a closer look before claiming any of this still works though. At some point it might be nice to reorganize viper.go too—it's getting pretty long—but not in this branch. |
@niccaluim Do you think this is ready for review/merge? |
@niccaluim PING :) |
any progress on this? |
Until the CLA is signed, this is stalled. @niccaluim would need to sign it at https://cla-assistant.io/spf13/viper?pullRequest=94 Then someone can try to merge this in and test it. |
@niccaluim can you sign the CLA https://cla-assistant.io/spf13/viper?pullRequest=94 so we can take over this PR and incorporate it into Viper? |
Hey there, sorry. I'll sign it just as soon as I get the ok from Legal. |
Alright, it's signed! Does it normally take a while for the check to update? |
Not usually. Try this link instead https://cla-assistant.io/spf13/viper . If it says you are good then you are already signed. |
Hmm, that doesn't seem to be working either. It shows me the CLA, I click to sign, it says I've signed and redirects me. |
Thanks for being patient. I've checked in the CLA backend and you have indeed signed it. Not sure why the PR isn't updating, but it's all good. Thanks! |
Are there any updates on this? As mentioned earlier in the thread, it's useful for reading Kubernetes secrets. |
This is becoming more relevant. Docker introspection feature is being implemented in the same way, currently it's slated as experimental, but might land in the following months. Related issue here |
So this would have been nice to have? This was opened on Jul 15, 2015!? @spf13 I notice this with more of your (awesome) opensource projects (lots of open issue's and merge requests). A little disappointed but very understandable... time is limited. To bad we don't have the option to clone our selfs :) |
Bill Robbins seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Any updates on this considering it's been open since quite a while? There's now even an issue about this: #1022 |
Would love to see this implemented to support the same use case - docker secrets |
I've added a ReadDir method that loads configuration from a directory tree. Each file in the tree is treated as a single setting: the filename is the key, and the file contents are the value. E.g.:
Calling
ReadDir("/config")
would produce the following configuration:No idea if you'll find this useful, but I thought I'd send it your way nonetheless.