You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fix] Fix Inconsistent Plan Errors in Permissions Resource (#5091)
## Changes
<!-- Summary of your changes that are easy to understand -->
This PR attempts to fix an issue where Terraform was intermittently
throwing "inconsistent final plan" errors when managing permissions,
where `access_control` elements appeared to be removed and re-added even
though their actual values were identical.
The hypothesis is that Terraform's `TypeSet` was treating `{group_name:
"X", permission_level: "Y"}` and `{group_name: "X", permission_level:
"Y", user_name: "", service_principal_name: ""}` as different elements
because the default hash function considers the presence of keys with
empty string values as distinct from absent keys, even though these are
semantically equivalent
The fix adds a custom hash function that normalizes elements by only
hashing non-empty string fields, so both representations produce the
same hash and are correctly recognized as identical.
## Tests
<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->
Existing test coverage + testing of the new hash function.
- [x] `make test` run locally
- [ ] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] using Go SDK
- [ ] using TF Plugin Framework
- [ ] has entry in `NEXT_CHANGELOG.md` file
---------
Co-authored-by: Omer Lachish <[email protected]>
Co-authored-by: Alex Ott <[email protected]>
0 commit comments