Closed KrishnaIyer closed 6 months ago
Ok for some reason I always thought that it's a general convention that env takes preference over flags, but that's not the case: https://github.com/spf13/viper#why-viper
The environment variables should be used as defaults for the flags
I don't really see the reason or value in this. These are not really defaults. It's just echoing the value set.
I don't really see the reason or value in this. These are not really defaults. It's just echoing the value set.
The reason is that we don't need for each individual flag manual code that says 'if flag is empty, check environment variable'. Since we don't use viper
here, for every single flag we would need to code this by hand, which is unnecessary if we use the defaults.
Ok cool. I don't have an argument against it.
Summary
Refs https://github.com/TheThingsNetwork/lorawan-stack-migrate/pull/112#discussion_r1519974219
Changes
tts
config to match other sources and don't print defaults to the env.Testing
TTS
Check that secrets are not printed.
Others
Check that env is only used when set.
Regressions
Tested export using the
tts
source.ttnv2
since that's not so easy.Checklist
CHANGELOG.md
.