未验证 提交 886d159a 编写于 作者: M Medya Ghazizadeh 提交者: GitHub

Proxy: handle lower case proxy env vars

上级 904bc49f
......@@ -468,6 +468,9 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
if !cmd.Flags().Changed("docker-env") {
for _, k := range proxy.EnvVars {
if v := os.Getenv(k); v != "" {
// convert https_proxy to HTTPS_PROXY for linux
// TODO (@medyagh): if user has both http_proxy & HTTPS_PROXY set merge them.
k = strings.ToUpper(k)
dockerEnv = append(dockerEnv, fmt.Sprintf("%s=%s", k, v))
}
}
......@@ -625,6 +628,7 @@ func validateNetwork(h *host.Host) string {
}
console.OutStyle(console.Option, "%s=%s", k, v)
ipExcluded := proxy.IsIPExcluded(ip) // Skip warning if minikube ip is already in NO_PROXY
k = strings.ToUpper(k) // for http_proxy & https_proxy
if (k == "HTTP_PROXY" || k == "HTTPS_PROXY") && !ipExcluded && !warnedOnce {
console.Warning("You appear to be using a proxy, but your NO_PROXY environment does not include the minikube IP (%s). Please see https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md for more details", ip)
warnedOnce = true
......
......@@ -29,7 +29,7 @@ import (
)
// EnvVars are variables we plumb through to the underlying container runtime
var EnvVars = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"}
var EnvVars = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"}
// isInBlock checks if ip is a CIDR block
func isInBlock(ip string, block string) (bool, error) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册