helper/schema: TypeMap computed should mark diff as cmputed

pull/632/head
Mitchell Hashimoto 11 years ago
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…
Cancel
Save