diff --git a/cmd/minikube/cmd/config/disable.go b/cmd/minikube/cmd/config/disable.go index a77f44092d12..76d6204c0d3b 100644 --- a/cmd/minikube/cmd/config/disable.go +++ b/cmd/minikube/cmd/config/disable.go @@ -33,6 +33,9 @@ var addonsDisableCmd = &cobra.Command{ } addon := args[0] + if addon == "heapster" { + exit.WithCodeT(exit.Unavailable, "The heapster addon is depreciated. please try to disable metrics-server instead") + } err := addons.SetAndSave(ClusterFlagValue(), addon, "false") if err != nil { exit.WithError("disable failed", err) diff --git a/cmd/minikube/cmd/config/enable.go b/cmd/minikube/cmd/config/enable.go index f05daadfd614..e3d28969ba80 100644 --- a/cmd/minikube/cmd/config/enable.go +++ b/cmd/minikube/cmd/config/enable.go @@ -32,6 +32,11 @@ var addonsEnableCmd = &cobra.Command{ exit.UsageT("usage: minikube addons enable ADDON_NAME") } addon := args[0] + // replace heapster as metrics-server because heapster is deprecated + if addon == "heapster" { + out.T(out.Waiting, "enable metrics-server addon instead of heapster addon because heapster is deprecated") + addon = "metrics-server" + } err := addons.SetAndSave(ClusterFlagValue(), addon, "true") if err != nil { exit.WithError("enable failed", err) diff --git a/pkg/addons/addons.go b/pkg/addons/addons.go index 56899c5a9d27..e7d58cc5c98d 100644 --- a/pkg/addons/addons.go +++ b/pkg/addons/addons.go @@ -334,7 +334,15 @@ func Start(wg *sync.WaitGroup, cc *config.ClusterConfig, toEnable map[string]boo // Apply new addons for _, name := range additional { - toEnable[name] = true + // replace heapster as metrics-server because heapster is deprecated + if name == "heapster" { + name = "metrics-server" + } + // if the specified addon doesn't exist, skip enabling + _, e := isAddonValid(name) + if e { + toEnable[name] = true + } } toEnableList := []string{}