Merge pull request #9776 from hashicorp/b-schema-computed

terraform: NewComputed doesn't quit Same logic
pull/9780/head
Mitchell Hashimoto 10 years ago committed by GitHub
commit 7db209d791

@ -615,7 +615,7 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) {
// that value is allowed since it may mean the value ended up
// being the same.
if diffOld.NewComputed {
continue
ok = true
}
// No exact match, but maybe this is a set containing computed

@ -608,6 +608,34 @@ func TestInstanceDiffSame(t *testing.T) {
"",
},
// NewComputed on set, removed
{
&InstanceDiff{
Attributes: map[string]*ResourceAttrDiff{
"foo.#": &ResourceAttrDiff{
Old: "",
New: "",
NewComputed: true,
},
},
},
&InstanceDiff{
Attributes: map[string]*ResourceAttrDiff{
"foo.1": &ResourceAttrDiff{
Old: "foo",
New: "",
NewRemoved: true,
},
"foo.2": &ResourceAttrDiff{
Old: "",
New: "bar",
},
},
},
true,
"",
},
{
&InstanceDiff{
Attributes: map[string]*ResourceAttrDiff{

Loading…
Cancel
Save