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
Readonly and optional computed properties have strange behaviour defined when under a list. If the ordering of the elements change, these properties do not "move" with the elements as expected.
To Reproduce
Define a resource with an object list with a nested property that is readonly or computed. Sample YAML
Create the resource with multiple elements in that object list, with only some elements where the computed property is populated. Sample HCL
Switch the ordering of the list. The plan shows that the read only and computed fields "stay" in place. Sample HCL
Apply the plan. The PUT request will show that computed fields are populated incorrectly in the payload. Any computed properties that were omitted in the plan can "absorb" the value from a neighbouring element.
Expected behaviour
The PUT request should be created as expected
Additional context
This seems more of a bug with terraform itself rather than the plugin, but a bandaid solution would help.
Describe the bug
Readonly and optional computed properties have strange behaviour defined when under a list. If the ordering of the elements change, these properties do not "move" with the elements as expected.
To Reproduce
Expected behaviour
The PUT request should be created as expected
Additional context
This seems more of a bug with terraform itself rather than the plugin, but a bandaid solution would help.
For pre-made tests to show the issue (though it has been fixed on the branch), check out
TestAcc_ArrayBasedComputedPropertiesUpdateCorrectly
andTestAcc_OrderIgnoredPlanIsStableWithReadOnlyProperties
from the branch and file https://github.com/instaclustr/terraform-provider-openapi/blob/bugfix/fix-wrong-computed-properties-behaviour-on-updates/tests/e2e/gray_box_cdns_test.goChecklist (for admin only)
Don't forget to go through the checklist to make sure the issue is created properly:
The text was updated successfully, but these errors were encountered: