Fix read data failure for TypeList defined in TypeSet#1195
Fix read data failure for TypeList defined in TypeSet#1195ms-zhenhua wants to merge 2 commits intohashicorp:mainfrom
Conversation
|
Hi @ms-zhenhua 👋 Thank you for submitting this change. The maintainers here cannot commit to reviewing the full consequences of the change at this time, however it would be helpful to understand the provider code leading up to the reason for this change. Generally opening a bug report issue would capture these details, such as how to reproduce the problem, before getting into code changes. In general though, the If we can better determine what situations this issue may occur and how it will affect existing dependent provider code, then we can potentially prioritize this better. 👍 Thanks again. |
…-sdk into fix-set-read-issue
|
Thanks @bflad. I have created an issue to give more details for this problem. |
Fix #1197
Scenario
If a schema has a set property which contains a list property as follows, GetOkExists may failed to read values of
prop_list.Reason
This line of
readListFieldwill finally run this code to change theaddressfromprop_set.xxxxx.prop_list.0toprop_set.0.prop_list.0. Since theaddressis changed,readListFieldcannot read values in array in subsequent code.Solution
Add a deep copy in
func (r *ConfigFieldReader) readFieldwhen changing the address.