Merge pull request #6671 from rhatdan/build

Fix podman build handling of --http-proxy flag
This commit is contained in:
OpenShift Merge Robot
2020-06-21 11:38:54 +02:00
committed by GitHub
2 changed files with 25 additions and 12 deletions

View File

@ -195,4 +195,21 @@ var _ = Describe("Podman build", func() {
Expect(session.ExitCode()).To(Equal(0))
})
It("podman build --http_proxy flag", func() {
SkipIfRemote()
os.Setenv("http_proxy", "1.2.3.4")
podmanTest.RestoreAllArtifacts()
dockerfile := `FROM docker.io/library/alpine:latest
RUN printenv http_proxy`
dockerfilePath := filepath.Join(podmanTest.TempDir, "Dockerfile")
err := ioutil.WriteFile(dockerfilePath, []byte(dockerfile), 0755)
Expect(err).To(BeNil())
session := podmanTest.PodmanNoCache([]string{"build", "--file", dockerfilePath, podmanTest.TempDir})
session.Wait(120)
Expect(session.ExitCode()).To(Equal(0))
ok, _ := session.GrepString("1.2.3.4")
Expect(ok).To(BeTrue())
os.Unsetenv("http_proxy")
})
})