From 3178cc2136cd4f9541d15616f84e90d36415cde6 Mon Sep 17 00:00:00 2001 From: Parthvi Vala Date: Mon, 16 Dec 2024 13:44:21 +0530 Subject: [PATCH] Fix: Cluster deletion is skipped if timeout happens in WaitUntilClusterIsReady Signed-off-by: Parthvi Vala --- hosted/helpers/helper_common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosted/helpers/helper_common.go b/hosted/helpers/helper_common.go index e9605a68..e7a906f5 100644 --- a/hosted/helpers/helper_common.go +++ b/hosted/helpers/helper_common.go @@ -139,14 +139,14 @@ func WaitUntilClusterIsReady(cluster *management.Cluster, client *rancher.Client opts := metav1.ListOptions{FieldSelector: "metadata.name=" + cluster.ID, TimeoutSeconds: &defaults.WatchTimeoutSeconds} watchInterface, err := client.GetManagementWatchInterface(management.ClusterType, opts) if err != nil { - return nil, err + return cluster, err } watchFunc := shepherdclusters.IsHostedProvisioningClusterReady err = wait.WatchWait(watchInterface, watchFunc) if err != nil { - return nil, err + return cluster, err } var updatedCluster *management.Cluster updatedCluster, err = client.Management.Cluster.ByID(cluster.ID)