Allow 'profiles list' to work even if a profile has no control plane

pull/6450/head
Thomas Stromberg 2020-01-31 14:32:54 -08:00
parent 79b3cc5643
commit 3ebbe4f1fc
1 changed files with 4 additions and 3 deletions

View File

@ -78,11 +78,12 @@ var printProfilesTable = func() {
for _, p := range validProfiles {
p.Status, err = cluster.GetHostStatus(api, p.Name)
if err != nil {
glog.Infof("error getting host status for %v", err)
glog.Infof("error getting host status for %s: %v", p.Name, err)
}
cp, err := config.PrimaryControlPlane(*p.Config)
if err != nil {
exit.WithError("profile has no control plane", err)
glog.Errorf("%q has no control plane: %v", p.Name, err)
// Print the data we know about anyways
}
validData = append(validData, []string{p.Name, p.Config.VMDriver, cp.IP, strconv.Itoa(cp.Port), p.Config.KubernetesConfig.KubernetesVersion, p.Status})
}
@ -119,7 +120,7 @@ var printProfilesJSON = func() {
for _, v := range validProfiles {
status, err := cluster.GetHostStatus(api, v.Name)
if err != nil {
glog.Infof("error getting host status for %v", err)
glog.Infof("error getting host status for %s: %v", v.Name, err)
}
v.Status = status
}