env: add bash-style default value operator :-#11787
env: add bash-style default value operator :-#11787benjaminmueggenburg-serato wants to merge 1 commit intofluent:masterfrom
Conversation
Signed-off-by: benjaminmueggenburg-serato <benjamin.mueggenburg@serato.com>
📝 WalkthroughWalkthroughThe PR adds bash-style default substitution syntax ChangesEnvironment Variable Default Substitution
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Super useful and makes things a lot more consistent with the usage of the |
Adds the familiar bash-style default value operator
:-.Now inside configuration files
${VALUE:-default}will resolve todefaultif VALUE variable is not set (os or locally) or is empty ''.Addresses #5517
Configuration example
Expand
Checklist (maintainers)
Debug / stdout
Unset
TEST_ZONESet
TEST_ZONE=eu-west-1:Unit tests
Valgrind summary / log tail
Command:
Valgrind tail:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
fluent/fluent-bit-docs#2568
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
Release Notes
New Features
${VAR:-fallback}now expand to the fallback value when the variable is unset or empty.Tests