mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #9776 from hashicorp/b-schema-computed
terraform: NewComputed doesn't quit Same logic
This commit is contained in:
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
|
// that value is allowed since it may mean the value ended up
|
||||||
// being the same.
|
// being the same.
|
||||||
if diffOld.NewComputed {
|
if diffOld.NewComputed {
|
||||||
continue
|
ok = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// No exact match, but maybe this is a set containing computed
|
// 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{
|
&InstanceDiff{
|
||||||
Attributes: map[string]*ResourceAttrDiff{
|
Attributes: map[string]*ResourceAttrDiff{
|
||||||
|
Loading…
Reference in New Issue
Block a user