Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard: When run as root, show URL instead of opening browser #5292

Merged
merged 2 commits into from
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmd/minikube/cmd/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net/http"
"os"
"os/exec"
"os/user"
"regexp"
"time"

Expand Down Expand Up @@ -128,7 +129,12 @@ var dashboardCmd = &cobra.Command{
exit.WithCodeT(exit.Unavailable, "{{.url}} is not accessible: {{.error}}", out.V{"url": url, "error": err})
}

if dashboardURLMode {
//check if current user is root
user, err := user.Current()
if err != nil {
exit.WithError("Unable to get current user", err)
}
if dashboardURLMode || user.Uid == "0" {
out.Ln(url)
} else {
out.T(out.Celebrate, "Opening {{.url}} in your default browser...", out.V{"url": url})
Expand Down