FAB-14709 Respect env override of vars not in conf
There is a deficiency in the way viper handles environment variable
overrides when unmarshaling to a structure. If the variable is not
present in the config file (but present in the structure) and is
overridden in the environment, then this override is ignored. This is
bizzare behavior which we have hacked around by putting all options into
the config file, but this policy is becoming untennable.
This CR adds (yet another) hacky layer in the viperutil package to
include fields from the structure which are not in the config into the
map which is ultimately used to populate the structure values.
The correct long-term approach is to stop using viper and handle this
ourselves. The actual logic we have stacked on top of viper to handle
these problems is very likely more code than it would take to implement
our own sane config unmarshaling.
Change-Id: I47102c64162f1efcd9e1bd21a563e6aedb88abab
Signed-off-by:
Jason Yellick <jyellick@us.ibm.com>
Please register or sign in to comment