diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-10-19 19:01:12 +0300 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-10-19 19:03:03 +0300 |
| commit | 860c41441b3bcf542b5701ae2257812879ce47b4 (patch) | |
| tree | 9940e557b86e346cc3989c45e4f512f58dab850b /internal | |
| parent | 10314cef906fd9b73e003be69c2f6b7b3d66570c (diff) | |
Set DTAIL_RUN_INTEGRATIONT_TEST to yes for integration tests
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/config/env.go | 7 | ||||
| -rw-r--r-- | internal/config/initializer.go | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/internal/config/env.go b/internal/config/env.go new file mode 100644 index 0000000..88b831d --- /dev/null +++ b/internal/config/env.go @@ -0,0 +1,7 @@ +package config + +import "os" + +func Env(env string) bool { + return "yes" == os.Getenv(env) +} diff --git a/internal/config/initializer.go b/internal/config/initializer.go index 35105bf..4d6a73b 100644 --- a/internal/config/initializer.go +++ b/internal/config/initializer.go @@ -82,8 +82,8 @@ func (in *initializer) transformConfig(sourceProcess source.Source, args *Args, // There are some special options which can be set by environment variable. func (in *initializer) readEnvironmentVars() { - if len(os.Getenv("DTAIL_SSH_DONT_ADD_HOSTS_TO_KNOWNHOSTS_FILE")) != 0 || - len(os.Getenv("DTAIL_JENKINS")) != 0 { + if Env("DTAIL_SSH_DONT_ADD_HOSTS_TO_KNOWNHOSTS_FILE") || + Env("DTAIL_JENKINS") { in.Client.SSHDontAddHostsToKnownHostsFile = true } } |
