-
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
azurerm_storage_management_policy
- Add existance check
#22966
azurerm_storage_management_policy
- Add existance check
#22966
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.
Hey @magodo, this change looks good minus what you called out with the locks. We should do a separate PR for that so we can get this in quicker
// TODO: support Requires Import | ||
if d.IsNewResource() { | ||
// This lock is to protect the existence checking when two storage mgmt policies are being created at the same time. | ||
locks.ByID(mgmtPolicyId.ID()) |
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 not sure we should go this route quite yet. We should do a separate PR with it's own test to confirm that this will fix that issue.
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.
Yeah, I've removed the locks.
internal/services/storage/storage_management_policy_resource_test.go
Outdated
Show resolved
Hide resolved
…est.go Co-authored-by: stephybun <[email protected]>
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 @magodo LGTM 👍
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
The concern is whether the lock here is necessary, as if that is the case, then I believe almost all of the existing resources should add that. But at least, it is needed for the use case in #18583.
Fix #18583
Test