summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-10-29 07:50:36 +0300
committerPaul Buetow <paul@buetow.org>2021-10-29 07:50:36 +0300
commitd556c13d430f291b615d538c35ebdaf9b53aa15d (patch)
tree1b5b78814e88ac09669cd62c216c97347343c253 /internal/config
parent3d24204754aff155de21b01e9e3d82eb460fb87f (diff)
Dont use relaxed SSH Auth mode anymore for integration tests
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/env.go9
-rw-r--r--internal/config/initializer.go7
2 files changed, 3 insertions, 13 deletions
diff --git a/internal/config/env.go b/internal/config/env.go
index 804a10a..1ccac9c 100644
--- a/internal/config/env.go
+++ b/internal/config/env.go
@@ -16,12 +16,3 @@ func Hostname() (string, error) {
}
return os.Hostname()
}
-
-// SSHKnownHostsFile returns the known hosts file path (useful for integration tests)
-func SSHKnownHostsFile() string {
- if len(os.Getenv("DTAIL_SSH_KNOWN_HOSTS_FILE")) > 0 {
- return os.Getenv("DTAIL_SSH_KNOWN_HOSTS_FILE")
- } else {
- return os.Getenv("HOME") + "/.ssh/known_hosts"
- }
-}
diff --git a/internal/config/initializer.go b/internal/config/initializer.go
index 024464e..137b831 100644
--- a/internal/config/initializer.go
+++ b/internal/config/initializer.go
@@ -65,7 +65,7 @@ func (in *initializer) parseSpecificConfig(configFile string) error {
func (in *initializer) transformConfig(sourceProcess source.Source, args *Args,
additionalArgs []string) error {
- in.readEnvironmentVars()
+ in.processEnvVars()
switch sourceProcess {
case source.Server:
@@ -81,10 +81,9 @@ 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 Env("DTAIL_RUN_INTEGRATION_TESTS") {
+func (in *initializer) processEnvVars() {
+ if Env("DTAIL_INTEGRATION_TEST_RUN_MODE") {
os.Setenv("DTAIL_HOSTNAME_OVERRIDE", "integrationtest")
- os.Setenv("DTAIL_SSH_KNOWN_HOSTS_FILE", "./known_hosts")
}
}