-
Notifications
You must be signed in to change notification settings - Fork 1.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
Storage bucket: Surface non-retryable object delete error #3336
Storage bucket: Surface non-retryable object delete error #3336
Conversation
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @danawillow, please review this PR or find an appropriate assignee. |
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
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.
Code LGTM. For a test, you could have one TestStep to get the config into the state such that deleting the bucket would error, and then a second TestStep that uses the same config but sets Destroy: true
and ExpectError
. If you do that, you'll want to have additional steps after that can "repair" it so that at the end of the test, the bucket is deleted (so we don't have dangling resources).
Thanks for the review and your suggestion - it helped me to write the test, (I totally misunderstood what |
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.
Looks great, thanks!
…dPlatform#3336) * Storage bucket: Surface non-retryable object delete error * storage: test deleting bucket with non-deletable objects error
Release Note Template for Downstream PRs (will be copied)
This PR fixes a bug when Storage Bucket delete operation is stuck in a never-ending loop when it can't delete objects - fixes hashicorp/terraform-provider-google#6034.
Please see the above-mentioned ticket on how to reproduce the issue.
With this PR in place, the terraform will give up when hitting a non-retryable error during objects delete (we will still try to delete the bucket in case we can):
I tried to add a test to cover this issue, but didn't find a way how to test Error on destroy with current
Test()
plumbing. If this is desirable I would appreciate help on how to best implement the test.