Skip to content

Commit

Permalink
Sets both lower and upper case http proxy vars
Browse files Browse the repository at this point in the history
Signed-off-by: Emily Casey <[email protected]>
Signed-off-by: Danny Joyce <[email protected]>
  • Loading branch information
ekcasey authored and Danny Joyce committed May 14, 2019
1 parent f986cb3 commit fa84abe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions build/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions build/testdata/fake-lifecycle/phase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit fa84abe

Please sign in to comment.