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 <angc@vmware.com>
This commit is contained in:
Guangyuan Wang 2021-06-24 22:35:16 +00:00
parent a6141e911c
commit d19d63ad7d

View File

@ -263,7 +263,12 @@ func (c *oidcWatcherController) validateIssuer(ctx context.Context, upstream *v1
Message: err.Error(), 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) discoveredProvider, err = oidc.NewProvider(oidc.ClientContext(ctx, httpClient), upstream.Spec.Issuer)
if err != nil { if err != nil {