Skip to content

Commit

Permalink
pass proxy variables to container
Browse files Browse the repository at this point in the history
  • Loading branch information
wgerlach committed May 13, 2019
1 parent 0d5387d commit 24ffd2d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/worker/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,16 @@ func RunWorkunitDocker(workunit *core.Workunit) (pstats *core.WorkPerf, err erro
logger.Debug(3, "HasPrivateEnv false")
}

proxyVariables := [4]string{"HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy"}
for _, proxyVar := range proxyVariables {
proxyVarValue := os.Getenv(proxyVar)
if proxyVarValue != "" {
envPair := proxyVar + "=" + proxyVarValue
docker_environment = append(docker_environment, envPair)
docker_environment_string += " --env=" + envPair
}
}

stdout_file := path.Join(conf.DOCKER_WORK_DIR, conf.STDOUT_FILENAME)
stderr_file := path.Join(conf.DOCKER_WORK_DIR, conf.STDERR_FILENAME)

Expand Down

0 comments on commit 24ffd2d

Please sign in to comment.