Skip to content

Commit

Permalink
fix: diconnect before delete
Browse files Browse the repository at this point in the history
  • Loading branch information
aldor007 committed Nov 14, 2023
1 parent 8d870b7 commit ba7e819
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions castai/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func resourceCastaiClusterDelete(ctx context.Context, data *schema.ResourceData,
clusterId := data.Id()

log.Printf("[INFO] Checking current status of the cluster.")
diconnectionTriggerd := false

err := retry.RetryContext(ctx, data.Timeout(schema.TimeoutDelete), func() *retry.RetryError {
clusterResponse, err := client.ExternalClusterAPIGetClusterWithResponse(ctx, clusterId)
Expand Down Expand Up @@ -65,12 +64,6 @@ func resourceCastaiClusterDelete(ctx context.Context, data *schema.ResourceData,
if checkErr := sdk.CheckOKResponse(response, err); checkErr != nil {
return retry.NonRetryableError(err)
}

if diconnectionTriggerd {
return triggerDelete()
}

diconnectionTriggerd = true
}

// If cluster doesn't have credentials we have to call delete cluster instead of disconnect because disconnect
Expand Down

0 comments on commit ba7e819

Please sign in to comment.