Skip to content

Commit

Permalink
feat: set GOPROXY=direct in fetch-service runs (#489)
Browse files Browse the repository at this point in the history
The value makes Go download directly from version-controlled repositories,
instead of module proxies like the default https://proxy.golang.org. It's
currently a requirement for the Go inspector.
  • Loading branch information
tigarmo authored Sep 24, 2024
1 parent 07e89de commit c971a60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions craft_application/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def env(self) -> dict[str, str]:
"REQUESTS_CA_BUNDLE": str(_FETCH_CERT_INSTANCE_PATH),
# Same, but for cargo.
"CARGO_HTTP_CAINFO": str(_FETCH_CERT_INSTANCE_PATH),
# Have go download directly from repositories
"GOPROXY": "direct",
}


Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def test_configure_build_instance(mocker):
"https_proxy": expected_proxy,
"REQUESTS_CA_BUNDLE": "/usr/local/share/ca-certificates/local-ca.crt",
"CARGO_HTTP_CAINFO": "/usr/local/share/ca-certificates/local-ca.crt",
"GOPROXY": "direct",
}

env = fetch.configure_instance(instance, session_data)
Expand Down

0 comments on commit c971a60

Please sign in to comment.