Skip to content

Commit 7755665

Browse files
authored
Merge pull request #1834 from rancher-sandbox/unset-proxies
Ignore system proxy settings by overriding with empty string
2 parents cb0c7ee + 279942a commit 7755665

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/cidata/cidata.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,12 @@ func setupEnv(y *limayaml.LimaYAML, args TemplateArgs) (map[string]string, error
6565
}
6666
}
6767
// Replace IP that IsLoopback in proxy settings with the gateway address
68+
// Delete settings with empty values, so the user can choose to ignore system settings.
6869
for _, name := range append(lowerVars, upperVars...) {
6970
value, ok := env[name]
70-
if ok && !strings.EqualFold(name, "no_proxy") {
71+
if ok && value == "" {
72+
delete(env, name)
73+
} else if ok && !strings.EqualFold(name, "no_proxy") {
7174
u, err := url.Parse(value)
7275
if err != nil {
7376
logrus.Warnf("Ignoring invalid proxy %q=%v: %s", name, value, err)

0 commit comments

Comments
 (0)