From d19d63ad7df70fc102a8b54775526c14952e0f97 Mon Sep 17 00:00:00 2001 From: Guangyuan Wang Date: Thu, 24 Jun 2021 22:35:16 +0000 Subject: [PATCH] Set Proxy on oidc upstream watcher transport - this allows the oidc upsream watcher to honor the HTTP_PROXY,HTTPS_PROXY,NO_PROXY environment variables Co-authored-by: Christian Ang --- .../oidcupstreamwatcher/oidc_upstream_watcher.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/controller/supervisorconfig/oidcupstreamwatcher/oidc_upstream_watcher.go b/internal/controller/supervisorconfig/oidcupstreamwatcher/oidc_upstream_watcher.go index b610a2c6..0768fd2c 100644 --- a/internal/controller/supervisorconfig/oidcupstreamwatcher/oidc_upstream_watcher.go +++ b/internal/controller/supervisorconfig/oidcupstreamwatcher/oidc_upstream_watcher.go @@ -263,7 +263,12 @@ func (c *oidcWatcherController) validateIssuer(ctx context.Context, upstream *v1 Message: err.Error(), } } - httpClient = &http.Client{Transport: &http.Transport{TLSClientConfig: tlsConfig}} + httpClient = &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + TLSClientConfig: tlsConfig, + }, + } discoveredProvider, err = oidc.NewProvider(oidc.ClientContext(ctx, httpClient), upstream.Spec.Issuer) if err != nil {