未验证 提交 ef1a48f3 编写于 作者: M Medya Ghazizadeh 提交者: GitHub

Merge pull request #8863 from medyagh/dont_metric

UI: suggest to enable `metric-server` for full feature dashboard addon.
......@@ -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"
)
......@@ -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})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册