Skip to content

Commit

Permalink
fix in dashboard.go to display dashborad url with root
Browse files Browse the repository at this point in the history
  • Loading branch information
dpandhi-git committed Sep 9, 2019
1 parent 35cfb7e commit 73aefd0
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 73aefd0

Please sign in to comment.