Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't pass scheme prefixed localhost proxy environment variables. #8881

Closed
lingsamuel opened this issue Jul 30, 2020 · 0 comments · Fixed by #8885
Closed

Shouldn't pass scheme prefixed localhost proxy environment variables. #8881

lingsamuel opened this issue Jul 30, 2020 · 0 comments · Fixed by #8885

Comments

@lingsamuel
Copy link
Contributor

lingsamuel commented Jul 30, 2020

func SetDockerEnv() []string {
for _, k := range 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)
if k == "HTTP_PROXY" || k == "HTTPS_PROXY" {
if strings.HasPrefix(v, "localhost") || strings.HasPrefix(v, "127.0") {
out.WarningT("Not passing {{.name}}={{.value}} to docker env.", out.V{"name": k, "value": v})
continue
}
}
config.DockerEnv = append(config.DockerEnv, fmt.Sprintf("%s=%s", k, v))
}
}

strings.HasPrefix(v, "localhost") || strings.HasPrefix(v, "127.0")

Proxy environment variables can start with scheme like http://.

/kind feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant