Skip to content

Commit

Permalink
Add more log for cluster deletion failure (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
jichenjc authored and k8s-ci-robot committed Jun 5, 2019
1 parent 76b4b9c commit 30a6532
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("retrying: failed to list clusters: %v", err)
return false, nil
}
for _, cluster := range clusters.Items {
if reflect.DeepEqual(clusterv1.ClusterStatus{}, cluster.Status) {
klog.V(10).Info("retrying: cluster status is empty")
return false, nil
}
if cluster.Status.ProviderStatus == nil {
klog.V(10).Info("retrying: 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("retrying: failed to list machine deployment: %v", err)
return false, nil
}
for _, md := range machineDeployments.Items {
if reflect.DeepEqual(clusterv1.MachineDeploymentStatus{}, md.Status) {
klog.V(10).Info("retrying: machine deployment status is empty")
return false, nil
}
}
machineSets, err := c.clientSet.ClusterV1alpha1().MachineSets("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("retrying: failed to list machinesets: %v", err)
return false, nil
}
for _, ms := range machineSets.Items {
if reflect.DeepEqual(clusterv1.MachineSetStatus{}, ms.Status) {
klog.V(10).Info("retrying: machineset status is empty")
return false, nil
}
}
machines, err := c.clientSet.ClusterV1alpha1().Machines("").List(metav1.ListOptions{})
if err != nil {
klog.V(10).Infof("retrying: failed to list machines: %v", err)
return false, nil
}
for _, m := range machines.Items {
if reflect.DeepEqual(clusterv1.MachineStatus{}, m.Status) {
klog.V(10).Info("retrying: machine status is empty")
return false, nil
}
if m.Status.ProviderStatus == nil {
klog.V(10).Info("retrying: machine.Status.ProviderStatus is not set")
return false, nil
}
}
Expand Down

0 comments on commit 30a6532

Please sign in to comment.