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

fix: set proxy env variable when launching process #3838

Merged
merged 3 commits into from Sep 11, 2023

Conversation

jeffmaury
Copy link
Contributor

Fixes #3768

What does this PR do?

Set the proxy environment variables when launching process using the extension API

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

Fixes #3768

How to test this PR?

  1. Create a proxy environment (install proxy, no network access outside proxy)
  2. Configure proxy in Podman Desktop
  3. Remove cached Podman machine images ($HOME/.local/share/containers/podman/machine/wsl on Windows)
  4. Create a Podman machine, make sure image is downloaded through the proxy

Fixes containers#3768

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
@jeffmaury jeffmaury requested review from benoitf and a team as code owners September 8, 2023 07:30
@jeffmaury jeffmaury requested review from dgolovin and lstocchi and removed request for a team September 8, 2023 07:30
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Comment on lines 34 to 45
if (proxy.isEnabled()) {
if (proxy.proxy?.httpsProxy) {
env.HTTPS_PROXY = 'http://' + proxy.proxy.httpsProxy;
}
if (proxy.proxy?.httpProxy) {
env.HTTP_PROXY = 'http://' + proxy.proxy.httpProxy;
}
if (proxy.proxy?.noProxy) {
env.NO_PROXY = proxy.proxy.noProxy;
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

it means that if extension is setting a proxy data, it'll be replaced all the times by Podman Desktop ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I don't see the use case

packages/main/src/plugin/util/exec.ts Outdated Show resolved Hide resolved
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Copy link
Collaborator

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

LGTM code wise

Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

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

LGTM

@cdrage cdrage merged commit 532d3b4 into containers:main Sep 11, 2023
8 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.4.0 milestone Sep 11, 2023
@jeffmaury jeffmaury deleted the GH-3768 branch November 27, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot create a Podman machine in a proxy environment
5 participants