Merge pull request #10800 from ahmetalpbalkan/TestRunEnv-fix
integration-cli: Preserve DOCKER_TEST_HOST in env-clearing tests Upstream-commit: 9ee8d41ab27181a919da11828c573c030e8a5611 Component: engine
This commit is contained in:
@ -897,3 +897,13 @@ func setupRegistry(t *testing.T) func() {
|
||||
|
||||
return func() { reg.Close() }
|
||||
}
|
||||
|
||||
// appendDockerHostEnv adds given env slice DOCKER_HOST value if set in the
|
||||
// environment. Useful when environment is cleared but we want to preserve DOCKER_HOST
|
||||
// to execute tests against a remote daemon.
|
||||
func appendDockerHostEnv(env []string) []string {
|
||||
if dockerHost := os.Getenv("DOCKER_HOST"); dockerHost != "" {
|
||||
env = append(env, fmt.Sprintf("DOCKER_HOST=%s", dockerHost))
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user