-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
ServiceBus Namespace: polling for the deletion #1908
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR Chang, LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lrxtom2,
Thank you for the bugfix. I've left a few minor comments inline that should be addressed before this is merged.
@@ -212,10 +213,19 @@ func resourceArmServiceBusNamespaceDelete(d *schema.ResourceData, meta interface | |||
resourceGroup := id.ResourceGroup | |||
name := id.Path["namespaces"] | |||
|
|||
_, err = client.Delete(ctx, resourceGroup, name) | |||
deleteFuture, err := client.Delete(ctx, resourceGroup, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we call this future
to match the rest of the codebase?
if err != nil { | ||
return err | ||
} | ||
|
||
err = deleteFuture.WaitForCompletionRef(ctx, client.Client) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines could be combines as such:
if err := deleteFuture.WaitForCompletionRef(ctx, client.Client); err != nil {
func testAccAzureRMServiceBusNamespace_premium(rInt int, location string) string { | ||
return fmt.Sprintf(` | ||
resource "azurerm_resource_group" "test" { | ||
name = "acctestRG-%d" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we align these assignments?
name = "acctestRG-%d" | ||
location = "%s" | ||
} | ||
resource "azurerm_servicebus_namespace" "test" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And add a space here between the resources
@katbyte Thanks for review, updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Deleting service bus in tanscation that resource group deletion will be blocked when sku set to premium.
Added WaitForCompletionRef method to make sure service bus was deleted and also added test for premium sku.
Thanks,
Chang