From eec99458ad59324221b1ba24bce6176622e4f9bc Mon Sep 17 00:00:00 2001 From: Asaf Yehezkel Date: Mon, 22 Jun 2026 14:01:06 +0300 Subject: [PATCH] Honor proxy env in overridden default HTTP client NewDefaultClient replaces the global http.DefaultClient but built its transport from a bare http.Transport{} (Proxy: nil), which dropped the HTTP(S)_PROXY/NO_PROXY support that the stock http.DefaultTransport provides via http.ProxyFromEnvironment. As a result every http.Get in the CLI (and in the helm-charts code it embeds) ignored proxy settings, so installs on proxied/offline hosts failed resolving api.github.com directly instead of dialing the proxy. Set Proxy: http.ProxyFromEnvironment on the replacement transport. Co-Authored-By: Claude Opus 4.8 --- pkg/api/utils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/api/utils.go b/pkg/api/utils.go index e73678726..291af7d51 100644 --- a/pkg/api/utils.go +++ b/pkg/api/utils.go @@ -120,7 +120,11 @@ func NewDefaultClient() *http.Client { customHttpClient := &http.Client{} roundTripper := &CustomRoundTripper{ - originalRoundTripper: http.Transport{}, + // Replaces the global http.DefaultClient, so it must keep honoring + // HTTP(S)_PROXY/NO_PROXY the way the stock http.DefaultTransport does. + originalRoundTripper: http.Transport{ + Proxy: http.ProxyFromEnvironment, + }, } customHttpClient.Transport = roundTripper