From 145d74716c9cbc8d6c83be5a8f6a575543d10d06 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 24 Apr 2020 12:45:00 +0200 Subject: podman: fix --http-proxy Signed-off-by: Giuseppe Scrivano --- cmd/podman/common/specgen.go | 16 ++++++++++++++++ test/e2e/run_test.go | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index e14fd78b4..9e8a271ae 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -288,7 +288,23 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string if c.EnvHost { env = envLib.Join(env, osEnv) + } else if c.HTTPProxy { + for _, envSpec := range []string{ + "http_proxy", + "HTTP_PROXY", + "https_proxy", + "HTTPS_PROXY", + "ftp_proxy", + "FTP_PROXY", + "no_proxy", + "NO_PROXY", + } { + if v, ok := osEnv[envSpec]; ok { + env[envSpec] = v + } + } } + // env-file overrides any previous variables for _, f := range c.EnvFile { fileEnv, err := envLib.ParseFile(f) diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 6386b8a70..7745bcf6a 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -877,7 +877,6 @@ USER mail` }) It("podman run --http-proxy test", func() { - Skip(v2fail) os.Setenv("http_proxy", "1.2.3.4") session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "http_proxy"}) session.WaitWithDefaultTimeout() -- cgit v1.2.3-54-g00ecf