-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add force_destroy flag to ACLs and Dicts to allow deleting non-empty lists #372
Add force_destroy flag to ACLs and Dicts to allow deleting non-empty lists #372
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.
LGTM. But would be great to get a couple of tests in the relevant ACL/Dictionary test files to validate the new behaviour.
Had to use a resource.TestCheckFunc with a side effect to add an entry/item as part of a TestStep. This leads to a six part test where we test renaming an empty list, add an entry, try renaming and expect an error, then use force_destroy and retry renaming, expecting it to succeed.
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.
LGTM @bengesoff just a couple of comments.
Co-authored-by: Mark McDonnell <[email protected]>
Updates service ACL and Dictionary blocks with extra protection to prevent the deletion of populated data that is dynamically added outside of a Terraform workflow.
Checks for non-empty ACL entries and Dictionary items before deleting ACLs and Dictionaries to reduce potential loss when updating either collection name.
Returns an error to the terraform user if
force_destroy
is not set on the ACL/Dictionary prior to updating.