Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: keeps the http_proxy value #16763

Merged
merged 1 commit into from
Dec 7, 2022

Conversation

sstosh
Copy link
Contributor

@sstosh sstosh commented Dec 7, 2022

In a proxy environment, http_proxy needs to keep
the value to use a proxy.

Signed-off-by: Toshiki Sonoda sonoda.toshiki@fujitsu.com

Does this PR introduce a user-facing change?

None

In a proxy environment, http_proxy needs to keep
the value to use a proxy.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
@@ -300,6 +300,11 @@ var _ = Describe("Podman build", func() {
})

It("podman build --http_proxy flag", func() {
if env, found := os.LookupEnv("http_proxy"); found {
defer os.Setenv("http_proxy", env)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure it does what you want. Here, the env variable is already set. The defer will set it again but it has not been unset as far as I can see.

Copy link
Contributor Author

@sstosh sstosh Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.Setenv("http_proxy", "1.2.3.4")

The http_proxy value is overwritten with 1.2.3.4 due to os.Setenv("http_proxy", "1.2.3.4") .
This value needs to revert the original value at this time.

defer os.Setenv("http_proxy", env) reverts the http_proxy to original value.

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

unrelated, but we really should not use 1.2.3.4 for these tests at all. This is a legit IP address and our CI tests are spamming this address which is not under our control. I create an issue for it.

@rhatdan
Copy link
Member

rhatdan commented Dec 7, 2022

/lgtm
/approve
Thanks @sstosh

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 7, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan, sstosh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2022
@openshift-merge-robot openshift-merge-robot merged commit 5b6a03f into containers:main Dec 7, 2022
@sstosh sstosh deleted the e2e-http_proxy branch December 13, 2022 00:24
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants