Skip to content

Commit

Permalink
Add more log for cluster deletion failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jichenjc committed Jun 3, 2019
1 parent 30d2ec8 commit 3e2f92d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,43 +754,53 @@ func (c *client) WaitForResourceStatuses() error {
klog.V(2).Info("Waiting for Cluster API resources to have statuses...")
clusters, err := c.clientSet.ClusterV1alpha1().Clusters("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("error list clusters:", err)
return false, nil
}
for _, cluster := range clusters.Items {
if reflect.DeepEqual(clusterv1.ClusterStatus{}, cluster.Status) {
klog.V(10).Infof("error: cluster status is empty")
return false, nil
}
if cluster.Status.ProviderStatus == nil {
klog.V(10).Infof("error: cluster.Status.ProviderStatus is not set")
return false, nil
}
}
machineDeployments, err := c.clientSet.ClusterV1alpha1().MachineDeployments("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("error list machine deployment:", err)
return false, nil
}
for _, md := range machineDeployments.Items {
if reflect.DeepEqual(clusterv1.MachineDeploymentStatus{}, md.Status) {
klog.V(10).Infof("error: machine deployment status is empty")
return false, nil
}
}
machineSets, err := c.clientSet.ClusterV1alpha1().MachineSets("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("error list machinesets:", err)
return false, nil
}
for _, ms := range machineSets.Items {
if reflect.DeepEqual(clusterv1.MachineSetStatus{}, ms.Status) {
klog.V(10).Infof("error: machineset status is empty")
return false, nil
}
}
machines, err := c.clientSet.ClusterV1alpha1().Machines("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("error list machines:", err)
return false, nil
}
for _, m := range machines.Items {
if reflect.DeepEqual(clusterv1.MachineStatus{}, m.Status) {
klog.V(10).Infof("error: machine status is empty", err)
return false, nil
}
if m.Status.ProviderStatus == nil {
klog.V(10).Infof("error: machine.Status.ProviderStatus is not set")
return false, nil
}
}
Expand Down

0 comments on commit 3e2f92d

Please sign in to comment.