From dd403b27698449d3a2a2ea05e8263cdd4704324f Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Sat, 5 May 2018 00:07:30 +0200 Subject: [PATCH] Add more log info when deleting k8s nodes --- cluster/reconcile.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/reconcile.go b/cluster/reconcile.go index a7efa4ac..866ad436 100644 --- a/cluster/reconcile.go +++ b/cluster/reconcile.go @@ -57,7 +57,7 @@ func reconcileWorker(ctx context.Context, currentCluster, kubeCluster *Cluster, for _, toDeleteHost := range wpToDelete { toDeleteHost.IsWorker = false if err := hosts.DeleteNode(ctx, toDeleteHost, kubeClient, toDeleteHost.IsControl, kubeCluster.CloudProvider.Name); err != nil { - return fmt.Errorf("Failed to delete worker node %s from cluster", toDeleteHost.Address) + return fmt.Errorf("Failed to delete worker node [%s] from cluster: %v", toDeleteHost.Address, err) } // attempting to clean services/files on the host if err := reconcileHost(ctx, toDeleteHost, true, false, currentCluster.SystemImages.Alpine, currentCluster.DockerDialerFactory, currentCluster.PrivateRegistriesMap); err != nil { @@ -97,7 +97,7 @@ func reconcileControl(ctx context.Context, currentCluster, kubeCluster *Cluster, return fmt.Errorf("Failed to initialize new kubernetes client: %v", err) } if err := hosts.DeleteNode(ctx, toDeleteHost, kubeClient, toDeleteHost.IsWorker, kubeCluster.CloudProvider.Name); err != nil { - return fmt.Errorf("Failed to delete controlplane node %s from cluster", toDeleteHost.Address) + return fmt.Errorf("Failed to delete controlplane node [%s] from cluster: %v", toDeleteHost.Address, err) } // attempting to clean services/files on the host if err := reconcileHost(ctx, toDeleteHost, false, false, currentCluster.SystemImages.Alpine, currentCluster.DockerDialerFactory, currentCluster.PrivateRegistriesMap); err != nil { @@ -162,7 +162,7 @@ func reconcileEtcd(ctx context.Context, currentCluster, kubeCluster *Cluster, ku continue } if err := hosts.DeleteNode(ctx, etcdHost, kubeClient, etcdHost.IsControl, kubeCluster.CloudProvider.Name); err != nil { - log.Warnf(ctx, "Failed to delete etcd node %s from cluster", etcdHost.Address) + log.Warnf(ctx, "Failed to delete etcd node [%s] from cluster: %v", etcdHost.Address, err) continue } // attempting to clean services/files on the host