Skip to content

Commit 64eab73

Browse files
authoredAug 30, 2024
Use sudo -n if --interactive=false (#19531)
1 parent 14c1ff4 commit 64eab73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎pkg/minikube/firewall/firewall.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"os/exec"
2222
"regexp"
2323
"runtime"
24+
"slices"
2425
"strings"
2526

2627
"github.com/spf13/viper"
@@ -65,7 +66,7 @@ func UnblockBootpd() error {
6566
cmdString.WriteString(fmt.Sprintf(" $ %s \n", strings.Join(c.Args, " ")))
6667
}
6768

68-
out.Styled(style.Permissions, "Your firewall is blocking bootpd which is required for socket_vmnet. The following commands will be executed to unblock bootpd:\n\n{{.commands}}\n", out.V{"commands": cmdString.String()})
69+
out.Styled(style.Permissions, "Your firewall is blocking bootpd which is required for this configuration. The following commands will be executed to unblock bootpd:\n\n{{.commands}}\n", out.V{"commands": cmdString.String()})
6970

7071
for _, c := range cmds {
7172
testArgs := append([]string{"-n"}, c.Args[1:]...)
@@ -75,6 +76,7 @@ func UnblockBootpd() error {
7576
klog.Infof("%v may require a password: %v", c.Args, err)
7677
if !viper.GetBool("interactive") {
7778
klog.Warningf("%s requires a password, and --interactive=false", c.Args)
79+
c.Args = slices.Insert(c.Args, 1, "-n")
7880
}
7981
}
8082
klog.Infof("running: %s", c.Args)

0 commit comments

Comments
 (0)