From 97db8b5f4c2d550ccaed5ded2676a1f2bf3acbf2 Mon Sep 17 00:00:00 2001 From: Daehyeok Mun Date: Fri, 13 Nov 2020 20:07:16 -0800 Subject: [PATCH] Add number of nodes for cluster in `minikube profile list` fixes \#6780 Add the Nodes column with the number of nodes the cluster has into `minikube profile list` output. --- cmd/minikube/cmd/config/profile_list.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/minikube/cmd/config/profile_list.go b/cmd/minikube/cmd/config/profile_list.go index 6151d59ecd5e..bf316b17d226 100644 --- a/cmd/minikube/cmd/config/profile_list.go +++ b/cmd/minikube/cmd/config/profile_list.go @@ -130,7 +130,7 @@ func profileStatus(p *config.Profile, api libmachine.API) string { func renderProfilesTable(ps [][]string) { table := tablewriter.NewWriter(os.Stdout) - table.SetHeader([]string{"Profile", "VM Driver", "Runtime", "IP", "Port", "Version", "Status"}) + table.SetHeader([]string{"Profile", "VM Driver", "Runtime", "IP", "Port", "Version", "Status", "Nodes"}) table.SetAutoFormatHeaders(false) table.SetBorders(tablewriter.Border{Left: true, Top: true, Right: true, Bottom: true}) table.SetCenterSeparator("|") @@ -146,7 +146,7 @@ func profilesToTableData(profiles []*config.Profile) [][]string { exit.Error(reason.GuestCpConfig, "error getting primary control plane", err) } - data = append(data, []string{p.Name, p.Config.Driver, p.Config.KubernetesConfig.ContainerRuntime, cp.IP, strconv.Itoa(cp.Port), p.Config.KubernetesConfig.KubernetesVersion, p.Status}) + data = append(data, []string{p.Name, p.Config.Driver, p.Config.KubernetesConfig.ContainerRuntime, cp.IP, strconv.Itoa(cp.Port), p.Config.KubernetesConfig.KubernetesVersion, p.Status, strconv.Itoa(len(p.Config.Nodes))}) } return data }