From 73aefd070e67719443c4abe8490868425814974a Mon Sep 17 00:00:00 2001 From: Deepika Pandhi Date: Sat, 7 Sep 2019 11:04:09 -0700 Subject: [PATCH] fix in dashboard.go to display dashborad url with root --- cmd/minikube/cmd/dashboard.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/dashboard.go b/cmd/minikube/cmd/dashboard.go index ca1192ae0ded..7678e5883746 100644 --- a/cmd/minikube/cmd/dashboard.go +++ b/cmd/minikube/cmd/dashboard.go @@ -23,6 +23,7 @@ import ( "net/http" "os" "os/exec" + "os/user" "regexp" "time" @@ -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})