1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 15:06:23 +00:00

Unset proxy env vars when ssh bastion is configured with option ignore_proxy_env_vars

This commit is contained in:
Pascal Morillon
2021-05-31 16:49:01 +02:00
parent a21294e915
commit 8b9385040f
2 changed files with 9 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"net"
"os"
"reflect"
"strings"
"time"
@@ -778,6 +779,12 @@ func (c *Cluster) SetupDialers(ctx context.Context, dailersOptions hosts.Dialers
if err != nil {
return err
}
if c.BastionHost.IgnoreProxyEnvVars {
logrus.Debug("Unset http proxy environment variables")
for _, v := range util.ProxyEnvVars {
os.Unsetenv(v)
}
}
}
return nil
}