The oc login command does not currently support the proxy-url option supported in the kubeconfig:
https://kubernetes.io/docs/reference/config-api/kubeconfig.v1/
Ideally it would be possible to pass something like --proxy-url=http://squid.redhat.com:3128 and oc login would use the proxy setting the same as if HTTPS_PROXY were set and configure the proxy-url setting for the cluster in the kubeconfig.
Current behavior is unfortunate because if proxy-url is manually set in the kubeconfig it works for normal commands, but when oc login is run again it not only doesn't work, but when HTTPS_PROXY environment variable is set it removes the proxy-url setting, breaking functionality for other oc commands.
This functionality is particularly important for cases where multiple clusters are managed through oc and some should use a proxy, some not, or different proxy servers should be used for different clusters.
The
oc logincommand does not currently support theproxy-urloption supported in the kubeconfig:https://kubernetes.io/docs/reference/config-api/kubeconfig.v1/
Ideally it would be possible to pass something like
--proxy-url=http://squid.redhat.com:3128andoc loginwould use the proxy setting the same as if HTTPS_PROXY were set and configure theproxy-urlsetting for the cluster in the kubeconfig.Current behavior is unfortunate because if
proxy-urlis manually set in the kubeconfig it works for normal commands, but whenoc loginis run again it not only doesn't work, but when HTTPS_PROXY environment variable is set it removes theproxy-urlsetting, breaking functionality for other oc commands.This functionality is particularly important for cases where multiple clusters are managed through
ocand some should use a proxy, some not, or different proxy servers should be used for different clusters.