Skip to content

Commit 25d304b

Browse files
committed
fix: profile list shows paused clusters as Running
1 parent 080f0ed commit 25d304b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

cmd/minikube/cmd/config/profile_list.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ var profileListCmd = &cobra.Command{
6161
func printProfilesTable() {
6262
validProfiles, invalidProfiles, err := config.ListProfiles()
6363

64-
if len(validProfiles) == 0 {
65-
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
66-
}
67-
6864
if err != nil {
6965
glog.Warningf("error loading profiles: %v", err)
7066
}
7167

68+
if len(validProfiles) == 0 {
69+
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
70+
}
71+
7272
updateProfilesStatus(validProfiles)
7373
renderProfilesTable(profilesToTableData(validProfiles))
7474
warnInvalidProfiles(invalidProfiles)
@@ -94,23 +94,26 @@ func profileStatus(p *config.Profile, api libmachine.API) string {
9494

9595
host, err := machine.LoadHost(api, driver.MachineName(*p.Config, cp))
9696
if err != nil {
97-
return ""
97+
glog.Warningf("error loading profiles: %v", err)
98+
return "Unknown"
9899
}
99100

100101
cr, err := machine.CommandRunner(host)
101102
if err != nil {
102-
return ""
103+
glog.Warningf("error loading profiles: %v", err)
104+
return "Unknown"
103105
}
104106

105107
hostname, _, port, err := driver.ControlPlaneEndpoint(p.Config, &cp, host.DriverName)
106108
if err != nil {
107-
return ""
109+
glog.Warningf("error loading profiles: %v", err)
110+
return "Unknown"
108111
}
109112

110113
status, err := kverify.APIServerStatus(cr, hostname, port)
111114
if err != nil {
112115
glog.Warningf("error getting apiserver status for %s: %v", p.Name, err)
113-
return ""
116+
return "Unknown"
114117
}
115118
return status.String()
116119
}

0 commit comments

Comments
 (0)