Merge pull request #7207 from hashicorp/b-diff-maps
core/diff: Fix attribute mismatch with tags.%
This commit is contained in:
commit
1f9a2b241e
|
@ -483,7 +483,7 @@ func (d *InstanceDiff) Same(d2 *InstanceDiff) (bool, string) {
|
|||
// Similarly, in a RequiresNew scenario, a list that shows up in the plan
|
||||
// diff can disappear from the apply diff, which is calculated from an
|
||||
// empty state.
|
||||
if d.RequiresNew() && strings.HasSuffix(k, ".#") {
|
||||
if d.RequiresNew() && (strings.HasSuffix(k, ".#") || strings.HasSuffix(k, ".%")) {
|
||||
ok = true
|
||||
}
|
||||
|
||||
|
|
|
@ -636,6 +636,38 @@ func TestInstanceDiffSame(t *testing.T) {
|
|||
true,
|
||||
"",
|
||||
},
|
||||
|
||||
{
|
||||
&InstanceDiff{
|
||||
Attributes: map[string]*ResourceAttrDiff{
|
||||
"reqnew": &ResourceAttrDiff{
|
||||
Old: "old",
|
||||
New: "new",
|
||||
RequiresNew: true,
|
||||
},
|
||||
"somemap.%": &ResourceAttrDiff{
|
||||
Old: "1",
|
||||
New: "0",
|
||||
},
|
||||
"somemap.oldkey": &ResourceAttrDiff{
|
||||
Old: "long ago",
|
||||
New: "",
|
||||
NewRemoved: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
&InstanceDiff{
|
||||
Attributes: map[string]*ResourceAttrDiff{
|
||||
"reqnew": &ResourceAttrDiff{
|
||||
Old: "",
|
||||
New: "new",
|
||||
RequiresNew: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
true,
|
||||
"",
|
||||
},
|
||||
}
|
||||
|
||||
for i, tc := range cases {
|
||||
|
|
Loading…
Reference in New Issue