Allow 'profiles list' to work even if a profile has no control plane
parent
79b3cc5643
commit
3ebbe4f1fc
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue