Skip to content

Commit 279942a

Browse files
committed
Ignore system proxy settings by overriding with empty string
Setting proxy variables to the empty string doesn't make sense, so just remove them completely. This allows the user to set `http_proxy` and friends to the empty string, either in lima.yaml or in the process environment before running `limactl start`. Signed-off-by: Jan Dubois <[email protected]>
1 parent 3561378 commit 279942a

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)