core/diff: Fix attribute mismatch with tags.%
This commit is contained in:
parent
f65a898a51
commit
9967641c4b
|
@ -488,7 +488,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
|
||||
}
|
||||
|
||||
|
|
|
@ -595,6 +595,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