-
-
Notifications
You must be signed in to change notification settings - Fork 79
feat: enhance environment variable handling in NewRepo, allow the rep… #760
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
base: main
Are you sure you want to change the base?
feat: enhance environment variable handling in NewRepo, allow the rep… #760
Conversation
…o uri to have envirnonment variables, prioritising first the ones from opts and then adding if any missing from the os environment
Thanks for the interest in contributing, generally open to supporting more expansions with some caveats -- I've been hesitant to blanket expand $ENV syntax as is done in shells as this may conflict with $ in a user's password or in an env var value or secret-- I don't want people to have to commonly escape values. I've settled at the moment for substituting anything of the form The existing env var expansion is implemented here
But isn't applied in as many places as it could be, env var substitution actually happens a layer above the package you're looking at. It happens here backrest/internal/orchestrator/repo/repo.go Lines 36 to 83 in 3ab6271
So the concrete changes I'd make are
|
feat: enhance environment variable handling in NewRepo, allow the repo uri to have envirnonment variables, prioritising first the ones from opts and then adding if any missing from the os environment