mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
helper/schema: TypeMap computed should mark diff as cmputed
This commit is contained in:
parent
c43eb6f883
commit
b73078c670
@ -584,6 +584,13 @@ func (m schemaMap) diffMap(
|
||||
|
||||
// If the new map is nil and we're computed, then ignore it.
|
||||
if n == nil && schema.Computed {
|
||||
// If we don't have an old value, this whole map is computed
|
||||
if o == nil {
|
||||
diff.Attributes[k] = &terraform.ResourceAttrDiff{
|
||||
NewComputed: true,
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -1292,6 +1292,29 @@ func TestSchemaMap_Diff(t *testing.T) {
|
||||
Err: false,
|
||||
},
|
||||
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"vars": &Schema{
|
||||
Type: TypeMap,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
|
||||
State: nil,
|
||||
|
||||
Config: nil,
|
||||
|
||||
Diff: &terraform.InstanceDiff{
|
||||
Attributes: map[string]*terraform.ResourceAttrDiff{
|
||||
"vars": &terraform.ResourceAttrDiff{
|
||||
NewComputed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Err: false,
|
||||
},
|
||||
|
||||
{
|
||||
Schema: map[string]*Schema{
|
||||
"config_vars": &Schema{
|
||||
|
Loading…
Reference in New Issue
Block a user