Skip to content

UI: suggest to enable metric-server for full feature dashboard addon. #8863

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

Merged
merged 2 commits into from
Jul 28, 2020
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
17 changes: 12 additions & 5 deletions cmd/minikube/cmd/config/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ limitations under the License.
package config

import (
"fmt"

"github.com/spf13/cobra"
"k8s.io/minikube/pkg/addons"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/out"
)
Expand All @@ -42,12 +45,16 @@ var addonsEnableCmd = &cobra.Command{
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)
tipProfileArg := ""
if ClusterFlagValue() != constants.DefaultClusterName {
tipProfileArg = fmt.Sprintf(" -p %s", ClusterFlagValue())
}
out.T(out.AddonEnable, "The 'metrics-server' add-on was enabled automatically")
out.T(out.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})

}

out.T(out.AddonEnable, "The '{{.addonName}}' addon is enabled", out.V{"addonName": addon})
Expand Down