Skip to content

Commit

Permalink
fix: profile list shows paused clusters as Running
Browse files Browse the repository at this point in the history
  • Loading branch information
taciomcosta committed Aug 20, 2020
1 parent 080f0ed commit 25d304b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cmd/minikube/cmd/config/profile_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ var profileListCmd = &cobra.Command{
func printProfilesTable() {
validProfiles, invalidProfiles, err := config.ListProfiles()

if len(validProfiles) == 0 {
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
}

if err != nil {
glog.Warningf("error loading profiles: %v", err)
}

if len(validProfiles) == 0 {
exit.UsageT("No minikube profile was found. You can create one using `minikube start`.")
}

updateProfilesStatus(validProfiles)
renderProfilesTable(profilesToTableData(validProfiles))
warnInvalidProfiles(invalidProfiles)
Expand All @@ -94,23 +94,26 @@ func profileStatus(p *config.Profile, api libmachine.API) string {

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

cr, err := machine.CommandRunner(host)
if err != nil {
return ""
glog.Warningf("error loading profiles: %v", err)
return "Unknown"
}

hostname, _, port, err := driver.ControlPlaneEndpoint(p.Config, &cp, host.DriverName)
if err != nil {
return ""
glog.Warningf("error loading profiles: %v", err)
return "Unknown"
}

status, err := kverify.APIServerStatus(cr, hostname, port)
if err != nil {
glog.Warningf("error getting apiserver status for %s: %v", p.Name, err)
return ""
return "Unknown"
}
return status.String()
}
Expand Down

0 comments on commit 25d304b

Please sign in to comment.