From aeee917262898cc29c211cadc49cc885b6a0d458 Mon Sep 17 00:00:00 2001 From: Marcin Kaciuba Date: Mon, 13 Nov 2023 16:31:58 +0100 Subject: [PATCH] fix: trying to fix tests --- castai/cluster.go | 8 ++++---- castai/resource_aks_cluster.go | 2 +- castai/resource_eks_cluster.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/castai/cluster.go b/castai/cluster.go index 10150ad9..d679dc8d 100644 --- a/castai/cluster.go +++ b/castai/cluster.go @@ -51,7 +51,7 @@ func resourceCastaiClusterDelete(ctx context.Context, data *schema.ResourceData, return retry.RetryableError(fmt.Errorf("triggered cluster deletion")) } - if agentStatus == sdk.ClusterAgentStatusDisconnected { + if agentStatus == sdk.ClusterAgentStatusDisconnected || agentStatus == "connecting" { return triggerDelete() } @@ -66,11 +66,11 @@ func resourceCastaiClusterDelete(ctx context.Context, data *schema.ResourceData, } if agentStatus == sdk.ClusterAgentStatusDisconnecting { - return retry.RetryableError(fmt.Errorf("agent is disconnecting")) + return retry.RetryableError(fmt.Errorf("agent is disconnecting cluster status %s agent status %s", clusterStatus, agentStatus)) } if clusterStatus == sdk.ClusterStatusDeleting { - return retry.RetryableError(fmt.Errorf("cluster is deleting")) + return retry.RetryableError(fmt.Errorf("cluster is deleting cluster status %s agent status", clusterStatus, agentStatus)) } if toString(clusterResponse.JSON200.CredentialsId) != "" && agentStatus != sdk.ClusterAgentStatusDisconnected { @@ -83,7 +83,7 @@ func resourceCastaiClusterDelete(ctx context.Context, data *schema.ResourceData, return retry.NonRetryableError(err) } - return retry.RetryableError(fmt.Errorf("triggered agent disconnection")) + return retry.RetryableError(fmt.Errorf("triggered agent disconnection cluster status %s agent status %s", clusterStatus, agentStatus)) } if agentStatus == sdk.ClusterAgentStatusDisconnected && clusterStatus != sdk.ClusterStatusDeleted { diff --git a/castai/resource_aks_cluster.go b/castai/resource_aks_cluster.go index 9fbcdf68..92bd5a64 100644 --- a/castai/resource_aks_cluster.go +++ b/castai/resource_aks_cluster.go @@ -36,7 +36,7 @@ func resourceAKSCluster() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(5 * time.Minute), Update: schema.DefaultTimeout(1 * time.Minute), - Delete: schema.DefaultTimeout(2 * time.Minute), + Delete: schema.DefaultTimeout(6 * time.Minute), }, Schema: map[string]*schema.Schema{ diff --git a/castai/resource_eks_cluster.go b/castai/resource_eks_cluster.go index 8243fc11..76f84192 100644 --- a/castai/resource_eks_cluster.go +++ b/castai/resource_eks_cluster.go @@ -33,7 +33,7 @@ func resourceEKSCluster() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(5 * time.Minute), Update: schema.DefaultTimeout(1 * time.Minute), - Delete: schema.DefaultTimeout(5 * time.Minute), + Delete: schema.DefaultTimeout(6 * time.Minute), }, Schema: map[string]*schema.Schema{