Skip to content

Commit

Permalink
Use noninteractive sudo when running podman
Browse files Browse the repository at this point in the history
To avoid asking for a password in the middle of minikube commands.

The setup process is supposed to involve adding podman to sudoers...
  • Loading branch information
afbjorklund committed May 1, 2020
1 parent 25ca347 commit 6d06708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/drivers/kic/oci/cli_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (rr RunResult) Output() string {
// PrefixCmd adds any needed prefix (such as sudo) to the command
func PrefixCmd(cmd *exec.Cmd) *exec.Cmd {
if cmd.Args[0] == Podman && runtime.GOOS == "linux" { // want sudo when not running podman-remote
cmdWithSudo := exec.Command("sudo", cmd.Args...)
cmdWithSudo := exec.Command("sudo", append([]string{"-n"}, cmd.Args...)...)
cmdWithSudo.Env = cmd.Env
cmdWithSudo.Dir = cmd.Dir
cmdWithSudo.Stdin = cmd.Stdin
Expand Down

0 comments on commit 6d06708

Please sign in to comment.