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
Update examples in documentation for env lookup plugin #62662
Conversation
You could instead use |
Rather than a change in behavior, we should add an example to the documentation of the solution @flowerysong suggested. |
Adding this new feature doesn't change the behavior. It just allows to set default value using one filter. But I agree, that documenting the |
The consensus amongst all of the core devs today, was that this feature would not be accepted. Replacing this feature with a docs pull request would be. |
OK. Let me amend the PR to document the use of the |
3cfad0b
to
06506d1
Compare
c48669d
to
7feb00b
Compare
@samdoran @sivel Please see the latest commit where I have removed my original implementation of the default value and just documented how to set default value via the To be honest, I'm not happy about such implementation as it doesn't allow to differentiate between env variable which is not defined and env variable which is defined but has empty string as its value. This is what the original PR was facilitating. |
ff6cc0b
to
46430e0
Compare
46430e0
to
b02547f
Compare
SUMMARY
The current
env
lookup plugin is setting the default value to empty string if the variable is not defined. This is nor particularly great as it doesn't allow to use thedefault()
filter if the variable is not defined. It would be great if we could change the default value from empty string toNone
but that would break the backward compatibility. This PR is keeping the current behavior (non-existing variable returns empty string) and it's adding the possibility to define custom default value. It also adds some basic unit tests.ISSUE TYPE
COMPONENT NAME
env
lookup pluginADDITIONAL INFORMATION