add FIXMEs

This new codepath with the getDiff "customzed" return value, along with
the associated test need to be removed as soon as we can support unset
fields from the config, so we don't continue to carry this broken
behavior forward any longer than needed.
This commit is contained in:
James Bardin 2017-12-20 08:46:45 -05:00
parent cb5ce1d35e
commit 0df8da59f7
2 changed files with 7 additions and 0 deletions

View File

@ -337,6 +337,11 @@ func (s *Schema) finalizeDiff(d *terraform.ResourceAttrDiff, customized bool) *t
} }
if s.Computed { 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 !customized {
if d.Old != "" && d.New == "" { if d.Old != "" && d.New == "" {
// This is a computed value with an old value set already, // This is a computed value with an old value set already,

View File

@ -3113,6 +3113,8 @@ func TestSchemaMap_Diff(t *testing.T) {
// A lot of resources currently depended on using the empty string as a // A lot of resources currently depended on using the empty string as a
// nil/unset value. // 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", Name: "optional, computed, empty string",
Schema: map[string]*Schema{ Schema: map[string]*Schema{