Commit cb16b7e
committed
fix(request_condition): save state before post-create calls
The Create function for okta_request_condition only persisted state
after every API call succeeded. When the initial POST created the
condition but a follow-up call failed (activation when the config sets
status = "ACTIVE", or the priority PATCH), Create returned error
diagnostics without ever calling resp.State.Set, so Terraform recorded
nothing. The condition was left orphaned in Okta as an unmanaged
INACTIVE draft, and the next apply created a duplicate.
Persist the created condition to state immediately after the create
POST succeeds, and refresh the saved state after successful activation,
so a mid-Create failure marks the resource as tainted instead of
orphaning it. State saved during Create is preserved by Terraform even
when error diagnostics are returned.
Fixes #28991 parent 3e47611 commit cb16b7e
1 file changed
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
214 | 231 | | |
215 | 232 | | |
216 | 233 | | |
| |||
224 | 241 | | |
225 | 242 | | |
226 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
227 | 257 | | |
228 | 258 | | |
229 | 259 | | |
| |||
0 commit comments