Skip to content

Commit

Permalink
fix: trying to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aldor007 committed Nov 14, 2023
1 parent deed807 commit aeee917
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions castai/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion castai/resource_aks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion castai/resource_eks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit aeee917

Please sign in to comment.