Skip to content

Commit

Permalink
Merge pull request containers#874 from rhatdan/proxy
Browse files Browse the repository at this point in the history
WEB Proxy is used in at least three different places in code
  • Loading branch information
openshift-merge-robot authored Jan 7, 2022
2 parents e275f5e + fff9cae commit 94fee1f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ const (
BoltDBStateStore RuntimeStateStore = iota
)

var ProxyEnvMap = map[string]bool{
"http_proxy": true,
"https_proxy": true,
"ftp_proxy": true,
"no_proxy": true,
"HTTP_PROXY": true,
"HTTPS_PROXY": true,
"FTP_PROXY": true,
"NO_PROXY": true,
}

// Config contains configuration options for container tools
type Config struct {
// Containers specify settings that configure how containers will run ont the system
Expand Down Expand Up @@ -897,8 +908,7 @@ func (c *Config) GetDefaultEnvEx(envHost, httpProxy bool) []string {
if envHost {
env = append(env, os.Environ()...)
} else if httpProxy {
proxy := []string{"http_proxy", "https_proxy", "ftp_proxy", "no_proxy", "HTTP_PROXY", "HTTPS_PROXY", "FTP_PROXY", "NO_PROXY"}
for _, p := range proxy {
for p := range ProxyEnvMap {
if val, ok := os.LookupEnv(p); ok {
env = append(env, fmt.Sprintf("%s=%s", p, val))
}
Expand Down

0 comments on commit 94fee1f

Please sign in to comment.