From 3e2f92dc87f78e8efcc6ae50b2ecd9e451965933 Mon Sep 17 00:00:00 2001 From: jichenjc Date: Mon, 3 Jun 2019 04:17:53 +0000 Subject: [PATCH] Add more log for cluster deletion failure --- .../clusterdeployer/clusterclient/clusterclient.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go b/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go index 3511982c82c4..c53e89cc8565 100644 --- a/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go +++ b/cmd/clusterctl/clusterdeployer/clusterclient/clusterclient.go @@ -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 } }