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: use proxy for wget #78

Merged
merged 6 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Tests

on:
pull_request: { }
pull_request: {}

jobs:
unit-tests:
uses: canonical/operator-workflows/.github/workflows/test.yaml@main
secrets: inherit
with:
self-hosted-runner: false
yhaliaw marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 10 additions & 1 deletion src/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,5 +635,14 @@ def _wget_install(self, executables: Iterable[WgetExecutable]) -> None:
for executable in executables:
executable_path = f"/usr/bin/{executable.cmd}"
logger.info("Downloading %s via wget to %s...", executable.url, executable_path)
self.instance.execute(["/usr/bin/wget", executable.url, "-O", executable_path])
wget_cmd = ["/usr/bin/wget", executable.url, "-O", executable_path]
if self.config.proxies.get("http", None) or self.config.proxies.get("https", None):
wget_cmd += ["-e", "use_proxy=on"]
if self.config.proxies.get("http", None):
wget_cmd += ["-e", f"http_proxy={self.config.proxies['http']}"]
if self.config.proxies.get("https", None):
wget_cmd += ["-e", f"https_proxy={self.config.proxies['https']}"]
if self.config.proxies.get("no_proxy", None):
wget_cmd += ["-e", f"no_proxy={self.config.proxies['no_proxy']}"]
self.instance.execute(wget_cmd)
self.instance.execute(["/usr/bin/chmod", "+x", executable_path])