Skip to content

Commit

Permalink
Merge pull request #8455 from govargo/add-heapster-alias
Browse files Browse the repository at this point in the history
Add heapster alias to metrics-server addon
  • Loading branch information
medyagh authored Jun 14, 2020
2 parents 101b612 + ab58dca commit 804e772
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/minikube/cmd/config/disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions cmd/minikube/cmd/config/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion pkg/addons/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 804e772

Please sign in to comment.