Skip to content

Commit

Permalink
The podman driver should not be run as root
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Apr 12, 2020
1 parent d734118 commit e4cecb4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/drivers/kic/oci/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func dockerSystemInfo() (dockerSysInfo, error) {
// podmanSysInfo returns podman system info --format '{{json .}}'
func podmanSystemInfo() (podmanSysInfo, error) {
var ps podmanSysInfo
cmd := exec.Command(Podman, "system", "info", "--format", "'{{json .}}'")
cmd := exec.Command("sudo", Podman, "system", "info", "--format", "'{{json .}}'")
out, err := cmd.CombinedOutput()
if err != nil {
return ps, errors.Wrap(err, "get podman system info")
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func BareMetal(name string) bool {

// NeedsRoot returns true if driver needs to run with root privileges
func NeedsRoot(name string) bool {
return name == None || name == Podman
return name == None
}

// NeedsPortForward returns true if driver is unable provide direct IP connectivity
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/registry/drvs/podman/podman.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func status() registry.State {
// Allow no more than 3 seconds for querying state
ctx, cancel = context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
err = exec.CommandContext(ctx, oci.Podman, "info").Run()
err = exec.CommandContext(ctx, "sudo", oci.Podman, "info").Run()
if err != nil {
return registry.State{Error: err, Installed: true, Healthy: false, Fix: "Podman is not running or taking too long to respond. Try: restarting podman."}
}
Expand Down

0 comments on commit e4cecb4

Please sign in to comment.