Commit c781c75
committed
Fix TypeSet hash to prevent spurious diffs on unchanged rules
The rule TypeSet was using the default hash function which includes ALL
fields, including the computed 'uuid' field. This caused Terraform to show
spurious diffs where unchanged rules appeared as being removed and re-added
when other rules in the same ruleset were modified.
Root Cause:
- When rule A is updated (e.g., action changes), its UUID may change
- The TypeSet hash included the UUID, so the set's internal representation
changed even for unchanged rules
- Terraform interpreted this as rules being removed and re-added, even
though only their position in the set changed
Solution:
- Added custom hash function resourceCloudStackNetworkACLRulesetRuleHash
- Hash is based only on user-configurable fields that define rule identity:
rule_number, action, protocol, traffic_type, cidr_list, port, icmp_type,
icmp_code, description
- Explicitly excludes the computed 'uuid' field
- This ensures rules are identified by their configuration, not by their
API-assigned UUID
All 11 acceptance tests passing (139.0 seconds total)1 parent 06543e2 commit c781c75
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
131 | 175 | | |
132 | 176 | | |
133 | 177 | | |
| |||
0 commit comments