Set lowercase version of proxy env vars in addition to uppercase

To hopefully ensure all tools respect proxy settings for a workspace,
add both upper- and lower-case versions of the proxy environment
variables to workspaces.

For example, curl will only use the lower-case http_proxy, and will
ignore HTTP_PROXY.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
pull/1770/head
Angel Misevski 2023-08-10 14:47:05 -04:00
parent 387f676773
commit 4b86b1eba6
1 changed files with 3 additions and 0 deletions

View File

@ -405,12 +405,15 @@ func (r *CheUserNamespaceReconciler) reconcileProxySettings(ctx context.Context,
proxySettings := map[string]string{}
if proxyConfig.HttpProxy != "" {
proxySettings["HTTP_PROXY"] = proxyConfig.HttpProxy
proxySettings["http_proxy"] = proxyConfig.HttpProxy
}
if proxyConfig.HttpsProxy != "" {
proxySettings["HTTPS_PROXY"] = proxyConfig.HttpsProxy
proxySettings["https_proxy"] = proxyConfig.HttpsProxy
}
if proxyConfig.NoProxy != "" {
proxySettings["NO_PROXY"] = proxyConfig.NoProxy
proxySettings["no_proxy"] = proxyConfig.NoProxy
}
key := client.ObjectKey{Name: prefixedName("proxy-settings"), Namespace: targetNs}