qbec
qbec copied to clipboard
Add ability to override qbec vars with env alone
At the moment, env var KEY can be used to set value for a qbec var named KEY but only if --vm:ext-str KEY is specified when invoking qbec command. The enhancement is to drop the requirement on specifying --vm-ext-str KEY.
With the following example from qbec.yaml, both qbec commands below should set the same value for std.extVar('KEY')
vars:
external:
- default: some-default-key
name: KEY
export KEY=mykey
qbec show default --vm-ext-str KEY
qbec show default
This means taking the stance that qbec doesn't respect jsonnet's hermetic behavior (only things passed explicitly on the command line can change the output). I'm not entirely opposed to it since it is a usability issue that frequently bites people in the backside because they expect that kind of behavior
If we choose to support this, I think there should be a way to opt-in to this behavior and not have it turned on by default.