Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_redhat_openshift_cluster - when deleting a cluster, if its already in the state of deleting it should wait and watch the delete to finish. #25739

Open
1 task done
paulczar opened this issue Apr 24, 2024 · 1 comment

Comments

@paulczar
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.4.6

AzureRM Provider Version

3.92.0

Affected Resource(s)/Data Source(s)

azurerm_redhat_openshift_cluster

Terraform Configuration Files

.

Debug Output/Panic Output

.

Expected Behaviour

when running an operation that would delete the cluster, either deleting it or doing a version change, if the cluster is already in a deleting state it should wait for the delete operation to finish and then update its state and move to the next resource.

Actual Behaviour

To perform exactly these actions, run the following command to apply:
    terraform apply "aro.plan"
terraform apply aro.plan
azurerm_redhat_openshift_cluster.cluster: Destroying... [id=/subscriptions/c5545383-1a94-45fe-b501-7ebdf43e5d7a/resourceGroups/aro-xx-rg/providers/Microsoft.RedHatOpenShift/openShiftClusters/aro-pczarkow]
╷
│ Error: deleting Provider Open Shift Cluster (Subscription: "c5545383-1a94-45fe-b501-7ebdf43e5d7a"
│ Resource Group Name: "aro-xx-rg"
│ Open Shift Cluster Name: "aro-xx"): performing Delete: unexpected status 400 with error: RequestNotAllowed: Request is not allowed in provisioningState 'Deleting'.
│
│ deleting Provider Open Shift Cluster (Subscription: "c5545383-1a94-45fe-b501-7ebdf43e5d7a"
│ Resource Group Name: "aro-xx-rg"
│ Open Shift Cluster Name: "aro-xx"): performing Delete: unexpected status 400 with error: RequestNotAllowed:
│ Request is not allowed in provisioningState 'Deleting'.
╵
make: *** [Makefile:18: create] Error 1

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@teowa
Copy link
Contributor

teowa commented Apr 25, 2024

@paulczar , thanks for submitting this.
From the source code, when we delete the azurerm_redhat_openshift_cluster resource, the provider is supposed wait until the response code changed from 200 to 404. Is it possible the deletion is triggered outside of terraform or in previous Terraform apply? Could you please share the debug log containing API https flow with TF_LOG=debug (please hide sensitive info in the log).

if err := client.DeleteThenPoll(ctx, *id); err != nil {

if resp.Response != nil {
switch resp.StatusCode {
case http.StatusNotFound:
{
result.Status = pollers.PollingStatusSucceeded
return
}
case http.StatusOK:
{
result.Status = pollers.PollingStatusInProgress
return
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants