-
Notifications
You must be signed in to change notification settings - Fork 24
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
Env var values not being loaded without a config file definition #48
Comments
@joao-zanutto thank you for your research. You're right. We can overcome this issue by manually registering ENV vars. It is completed in #51 . Rebase from the actual main branch and adapt your PR #49 last changes. About the next points
Agree. You can add it into #49
Looks like I have done it in #51 |
@wwoytenko following my previous implementation and your own, we would need to statically bind each env to have it working, however, I was thinking in making the bind dynamically using the I tried a few solution, (like the one described in this comment spf13/viper#584 (comment)) but ended up finding a new build flag we can add to make it work out of the box. There is a new private function I already built and test locally and it is working, however it doesn't work for the S3 storage parameters because it's defined as a pointer and the function can't parse it properly (See spf13/viper#1429 (comment)). Is there a chance we can remove the pointer definition se we don't have to statically define each S3 parameter as its own env and bind them individually? |
I think you can easily get rid of the pointers. It should work as expected, verify that all is okay and NewConfig function calls correctly |
Leave a comment in the code and Makefile as well so we would determine why it uses build flags |
I did as you instructed but may have missed something because I cannot make it work correctly and I'm having difficult troubleshooting it. May I have your assistance in #55 ? |
@wwoytenko I encountered a problem where environment variables are not being loaded if their config isn't defined in a config file. It seems that this is a known Viper issue: spf13/viper#584
I'll come up with a PR to solve this issue, changing the
common.tmp_dir
default definition.We can also utilize this PR to set a default behavior for
storage
config. I see these possible scenarios~/dumps
-- this would allow Docker users to map a volume to/home/greenmask/dumps
and use it without needing to specify thestorage.directory.path
configurationThe text was updated successfully, but these errors were encountered: