Skip to content

Commit 886d159

Browse files
authored
Proxy: handle lower case proxy env vars
1 parent 904bc49 commit 886d159

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: cmd/minikube/cmd/start.go

+4
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
468468
if !cmd.Flags().Changed("docker-env") {
469469
for _, k := range proxy.EnvVars {
470470
if v := os.Getenv(k); v != "" {
471+
// convert https_proxy to HTTPS_PROXY for linux
472+
// TODO (@medyagh): if user has both http_proxy & HTTPS_PROXY set merge them.
473+
k = strings.ToUpper(k)
471474
dockerEnv = append(dockerEnv, fmt.Sprintf("%s=%s", k, v))
472475
}
473476
}
@@ -625,6 +628,7 @@ func validateNetwork(h *host.Host) string {
625628
}
626629
console.OutStyle(console.Option, "%s=%s", k, v)
627630
ipExcluded := proxy.IsIPExcluded(ip) // Skip warning if minikube ip is already in NO_PROXY
631+
k = strings.ToUpper(k) // for http_proxy & https_proxy
628632
if (k == "HTTP_PROXY" || k == "HTTPS_PROXY") && !ipExcluded && !warnedOnce {
629633
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)
630634
warnedOnce = true

Diff for: pkg/minikube/proxy/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
// EnvVars are variables we plumb through to the underlying container runtime
32-
var EnvVars = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"}
32+
var EnvVars = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"}
3333

3434
// isInBlock checks if ip is a CIDR block
3535
func isInBlock(ip string, block string) (bool, error) {

0 commit comments

Comments
 (0)