From 17df0cdff7ade0d19f53bd5d839299639365a7a6 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Tue, 12 Dec 2023 12:52:47 -0800 Subject: [PATCH 1/3] addons headlamp: Add profile to command output --- pkg/addons/addons.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/addons/addons.go b/pkg/addons/addons.go index c03551d86c..a0d0a01340 100644 --- a/pkg/addons/addons.go +++ b/pkg/addons/addons.go @@ -125,9 +125,9 @@ func postStartMessages(cc *config.ClusterConfig, name, value string) { `, out.V{"profileArg": tipProfileArg}) case "headlamp": out.Styled(style.Tip, `To access Headlamp, use the following command: -minikube service headlamp -n headlamp +minikube{{.profileArg}} service headlamp -n headlamp -`) +`, out.V{"profileArg": tipProfileArg}) tokenGenerationTip := "To authenticate in Headlamp, fetch the Authentication Token using the following command:" createSvcAccountToken := "kubectl create token headlamp --duration 24h -n headlamp" getSvcAccountToken := `export SECRET=$(kubectl get secrets --namespace headlamp -o custom-columns=":metadata.name" | grep "headlamp-token") From d1aac7a76a1ddc1e4c287002daf088e005fe4226 Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 20 Dec 2023 11:55:54 -0800 Subject: [PATCH 2/3] fix formatting of enable output --- pkg/addons/addons.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/addons/addons.go b/pkg/addons/addons.go index a0d0a01340..8578c9eb2f 100644 --- a/pkg/addons/addons.go +++ b/pkg/addons/addons.go @@ -120,13 +120,13 @@ func postStartMessages(cc *config.ClusterConfig, name, value string) { case "dashboard": out.Styled(style.Tip, `Some dashboard features require the metrics-server addon. To enable all features please run: - minikube{{.profileArg}} addons enable metrics-server + minikube{{.profileArg}} addons enable metrics-server `, out.V{"profileArg": tipProfileArg}) case "headlamp": out.Styled(style.Tip, `To access Headlamp, use the following command: -minikube{{.profileArg}} service headlamp -n headlamp + minikube{{.profileArg}} service headlamp -n headlamp `, out.V{"profileArg": tipProfileArg}) tokenGenerationTip := "To authenticate in Headlamp, fetch the Authentication Token using the following command:" createSvcAccountToken := "kubectl create token headlamp --duration 24h -n headlamp" @@ -139,22 +139,20 @@ kubectl get secret $SECRET --namespace headlamp --template=\{\{.data.token\}\} | tokenGenerationTip = fmt.Sprintf("%s\nIf Kubernetes Version is <1.24:\n%s\n\nIf Kubernetes Version is >=1.24:\n%s\n", tokenGenerationTip, createSvcAccountToken, getSvcAccountToken) } else { if parsedClusterVersion.GTE(semver.Version{Major: 1, Minor: 24}) { - tokenGenerationTip = fmt.Sprintf("%s\n%s", tokenGenerationTip, createSvcAccountToken) + tokenGenerationTip = fmt.Sprintf("%s\n\n %s", tokenGenerationTip, createSvcAccountToken) } else { - tokenGenerationTip = fmt.Sprintf("%s\n%s", tokenGenerationTip, getSvcAccountToken) + tokenGenerationTip = fmt.Sprintf("%s\n\n %s", tokenGenerationTip, getSvcAccountToken) } } out.Styled(style.Tip, fmt.Sprintf("%s\n", tokenGenerationTip)) out.Styled(style.Tip, `Headlamp can display more detailed information when metrics-server is installed. To install it, run: -minikube{{.profileArg}} addons enable metrics-server - + minikube{{.profileArg}} addons enable metrics-server `, out.V{"profileArg": tipProfileArg}) case "yakd": out.Styled(style.Tip, `To access YAKD - Kubernetes Dashboard, wait for Pod to be ready and run the following command: minikube{{.profileArg}} service yakd-dashboard -n yakd-dashboard - `, out.V{"profileArg": tipProfileArg}) } } From 71aab1442e99109743bbb475744d6e9fd3bcee2b Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Wed, 20 Dec 2023 12:09:16 -0800 Subject: [PATCH 3/3] remove newline from dashboard output --- pkg/addons/addons.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/addons/addons.go b/pkg/addons/addons.go index 8578c9eb2f..e1d31904fb 100644 --- a/pkg/addons/addons.go +++ b/pkg/addons/addons.go @@ -121,7 +121,6 @@ func postStartMessages(cc *config.ClusterConfig, name, value string) { out.Styled(style.Tip, `Some dashboard features require the metrics-server addon. To enable all features please run: minikube{{.profileArg}} addons enable metrics-server - `, out.V{"profileArg": tipProfileArg}) case "headlamp": out.Styled(style.Tip, `To access Headlamp, use the following command: