qbec icon indicating copy to clipboard operation
qbec copied to clipboard

Add ability to override qbec vars with env alone

Open harsimranmaan opened this issue 5 years ago • 2 comments

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

harsimranmaan avatar Jul 23 '20 23:07 harsimranmaan

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

gotwarlost avatar Aug 07 '20 20:08 gotwarlost

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.

gotwarlost avatar Sep 09 '20 21:09 gotwarlost