Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proxy: Use our own http transport with crc's proxy config
At the moment, when a proxy is used, crc starts by setting `NO_PROXY` with some generic values (localhost), and once it knows which bundle it's going to be using, it adds the domain(s) used by the bundle to the `NO_PROXY` environment variable. Early during startup, it's sending HTTP request to check the latest crc version available, and it uses `http.DefaultTransport`/`ProxyFromEnvironment` for that. This is causing problems further down the road, as `ProxyFromEnvironment` will only read NO_PROXY/HTTP_PROXY/HTTPS_PROXY once, and will use these cached values for the lifetime of the process. This means `ProxyFromEnvironment` will never know about `.testing` which is only added later. This causes errors at the very end of the startup process when a proxy is used: `Cannot update kubeconfig: Head "https://oauth-openshift.apps-crc.testing": Service not available` `oauth-openshift.apps-crc.testing` is accessed through the proxy as `NO_PROXY` is not up to date. In order to avoid this issue, this commit introduces a crc specific `ProxyFunc` which will use directly the http_proxy/https_proxy/no_proxy settings from crc rather than getting these from the environment. This can still be problematic as `oc` code does not always use the http transport that we pass to it: openshift/oc#837 but for now this seems to be working well enough.
- Loading branch information
1 parent
a87e27f
commit 1972b9e
Showing
3 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters