-
Notifications
You must be signed in to change notification settings - Fork 485
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
Allow escaping $ in config files that use expand env #5576
Conversation
Signed-off-by: Kevin Fox <Kevin.Fox@pnnl.gov>
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.
SPIRE for better or worse accommodates a bring-your-own-main approach so main
isn't quite the right place for this. Further, we can leverage the [os.Expand] function instead of os.ExpandEnv to avoid having to set/unset an environment variable.
I'd suggest adding a function in pkg/common/config or something called ExpandEnv that:
- Called os.Getenv to gather the current environment
- Added the '$' entry
- called os.Expand
This function could then be called in place of os.ExpandEnv in the agent/server run packages.
Signed-off-by: Kevin Fox <Kevin.Fox@pnnl.gov>
…o expand-escape
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.
Thanks, @kfox1111 !
Fixes #5574.
$$ will match an env var named '$' which resolves to '$', allowing passing through '$'s.