kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.5k stars 4.89k forks source link

--interactive=false is ignored #19518

Closed nirs closed 2 months ago

nirs commented 2 months ago

What Happened?

Actual behavior:

When starting minikube with --interactive=false, minikube run sudo command without -n, triggering sudo password prompts.

Expected behavior:

If interaction is disabled use sudo -n and fail immediately if sudo without a password is not configured for the command.

Example run:

% minikube start --driver qemu --memory 2g --container-runtime containerd --interactive=false --alsologtostderr -v=4
...
| I0827 02:16:48.390075   16853 out.go:177] 🔑  Your firewall is blocking bootpd which is required for socket_vmnet. The following commands will be executed to unblock bootpd:

    $ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd 
    $ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd 

🔑  Your firewall is blocking bootpd which is required for socket_vmnet. The following commands will be executed to unblock bootpd:

    $ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd 
    $ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd 

I0827 02:16:48.395109   16853 firewall.go:73] testing: [sudo -n /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd]
I0827 02:16:48.414543   16853 firewall.go:75] [sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd] may require a password: exit status 1
W0827 02:16:48.414588   16853 firewall.go:77] [sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd] requires a password, and --interactive=false
I0827 02:16:48.414592   16853 firewall.go:80] running: [sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd]
Password:

Attach the log file

log.txt

Operating System

macOS (Default)

Driver

QEMU