diff --git a/helper/schema/schema.go b/helper/schema/schema.go index edcf58e8f..d9a7aa1a0 100644 --- a/helper/schema/schema.go +++ b/helper/schema/schema.go @@ -337,6 +337,11 @@ func (s *Schema) finalizeDiff(d *terraform.ResourceAttrDiff, customized bool) *t } if s.Computed { + // FIXME: This is where the customized bool from getChange finally + // comes into play. It allows the previously incorrect behavior + // of an empty string being used as "unset" when the value is + // computed. This should be removed once we can properly + // represent an unset/nil value from the configuration. if !customized { if d.Old != "" && d.New == "" { // This is a computed value with an old value set already, diff --git a/helper/schema/schema_test.go b/helper/schema/schema_test.go index 72adca4bb..bda54ccee 100644 --- a/helper/schema/schema_test.go +++ b/helper/schema/schema_test.go @@ -3113,6 +3113,8 @@ func TestSchemaMap_Diff(t *testing.T) { // A lot of resources currently depended on using the empty string as a // nil/unset value. + // FIXME: We want this to eventually produce a diff, since there + // technically is a new value in the config. { Name: "optional, computed, empty string", Schema: map[string]*Schema{