From fa84abe7d34c67adac25deffbfbec2b666aee39a Mon Sep 17 00:00:00 2001 From: Emily Casey Date: Tue, 14 May 2019 14:53:01 -0400 Subject: [PATCH] Sets both lower and upper case http proxy vars Signed-off-by: Emily Casey Signed-off-by: Danny Joyce --- build/lifecycle_test.go | 3 +++ build/phase.go | 3 +++ build/testdata/fake-lifecycle/phase.go | 3 +++ 3 files changed, 9 insertions(+) diff --git a/build/lifecycle_test.go b/build/lifecycle_test.go index 0f04ceb295..5074089d16 100644 --- a/build/lifecycle_test.go +++ b/build/lifecycle_test.go @@ -145,6 +145,9 @@ func testLifecycle(t *testing.T, when spec.G, it spec.S) { h.AssertContains(t, outBuf.String(), "HTTP_PROXY=some-http-proxy") h.AssertContains(t, outBuf.String(), "HTTPS_PROXY=some-https-proxy") h.AssertContains(t, outBuf.String(), "NO_PROXY=some-no-proxy") + h.AssertContains(t, outBuf.String(), "http_proxy=some-http-proxy") + h.AssertContains(t, outBuf.String(), "https_proxy=some-https-proxy") + h.AssertContains(t, outBuf.String(), "no_proxy=some-no-proxy") }) when("#WithArgs", func() { diff --git a/build/phase.go b/build/phase.go index bc09dbf8fc..586cd152a7 100644 --- a/build/phase.go +++ b/build/phase.go @@ -55,12 +55,15 @@ func (l *Lifecycle) NewPhase(name string, ops ...func(*Phase) (*Phase, error)) ( if l.httpProxy != "" { phase.ctrConf.Env = append(phase.ctrConf.Env, "HTTP_PROXY="+l.httpProxy) + phase.ctrConf.Env = append(phase.ctrConf.Env, "http_proxy="+l.httpProxy) } if l.httpsProxy != "" { phase.ctrConf.Env = append(phase.ctrConf.Env, "HTTPS_PROXY="+l.httpsProxy) + phase.ctrConf.Env = append(phase.ctrConf.Env, "https_proxy="+l.httpsProxy) } if l.noProxy != "" { phase.ctrConf.Env = append(phase.ctrConf.Env, "NO_PROXY="+l.noProxy) + phase.ctrConf.Env = append(phase.ctrConf.Env, "no_proxy="+l.noProxy) } var err error diff --git a/build/testdata/fake-lifecycle/phase.go b/build/testdata/fake-lifecycle/phase.go index 1018c354ae..f6bee7d956 100644 --- a/build/testdata/fake-lifecycle/phase.go +++ b/build/testdata/fake-lifecycle/phase.go @@ -139,6 +139,9 @@ func testProxy() { fmt.Println("HTTP_PROXY="+os.Getenv("HTTP_PROXY")) fmt.Println("HTTPS_PROXY="+os.Getenv("HTTPS_PROXY")) fmt.Println("NO_PROXY="+os.Getenv("NO_PROXY")) + fmt.Println("http_proxy="+os.Getenv("http_proxy")) + fmt.Println("https_proxy="+os.Getenv("https_proxy")) + fmt.Println("no_proxy="+os.Getenv("no_proxy")) } func testBinds() {