mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
helper/schema: Move computed key reader logic to childAddrOf
This will make this check safer and will remove the risk of it passing on keys with a similar prefix.
This commit is contained in:
parent
36aa63b338
commit
3444549d60
@ -78,7 +78,7 @@ func (r *newValueReader) ReadField(address []string) (FieldReadResult, error) {
|
||||
return FieldReadResult{}, err
|
||||
}
|
||||
for computedKey := range r.computedKeys {
|
||||
if strings.HasPrefix(addrKey, computedKey) {
|
||||
if childAddrOf(addrKey, computedKey) {
|
||||
if strings.HasSuffix(addrKey, ".#") {
|
||||
// This is a count value for a list or set that has been marked as
|
||||
// computed, or a sub-list/sub-set of a complex resource that has
|
||||
|
Loading…
Reference in New Issue
Block a user