From 8578e09d3f32cba68d5a2a3cdfa83e63bcacd0a6 Mon Sep 17 00:00:00 2001 From: Pablo Caderno Date: Sun, 26 Jul 2020 12:52:18 +1000 Subject: [PATCH] Enabling metrics addon when someone enables dashboard Signed-off-by: Pablo Caderno --- cmd/minikube/cmd/config/enable.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/minikube/cmd/config/enable.go b/cmd/minikube/cmd/config/enable.go index e3d28969ba80..ecdba654e431 100644 --- a/cmd/minikube/cmd/config/enable.go +++ b/cmd/minikube/cmd/config/enable.go @@ -41,6 +41,15 @@ var addonsEnableCmd = &cobra.Command{ if err != nil { exit.WithError("enable failed", err) } + if addon == "dashboard" { + out.T(out.Waiting, "Some dashboard features require the 'metrics-server' add-on") + err = addons.SetAndSave(ClusterFlagValue(), "metrics-server", "true") + if err != nil { + exit.WithError("enable failed", err) + } + out.T(out.AddonEnable, "The 'metrics-server' add-on was enabled automatically") + } + out.T(out.AddonEnable, "The '{{.addonName}}' addon is enabled", out.V{"addonName": addon}) }, }