ignore id when creating diffs
The id field is always computed, and never directly related to a diff. Since that field is being converted to a regular schema attribute, we need to handle the behavior in the mocks too.
This commit is contained in:
parent
129f5fe74d
commit
7137d85522
|
@ -265,6 +265,12 @@ func testDiffFn(
|
|||
}
|
||||
|
||||
for k, attrDiff := range testFlatAttrDiffs(k, v) {
|
||||
// we need to ignore 'id' for now, since it's always inferred to be
|
||||
// computed.
|
||||
if k == "id" {
|
||||
continue
|
||||
}
|
||||
|
||||
if k == "require_new" {
|
||||
attrDiff.RequiresNew = true
|
||||
}
|
||||
|
@ -281,6 +287,9 @@ func testDiffFn(
|
|||
}
|
||||
|
||||
for _, k := range c.ComputedKeys {
|
||||
if k == "id" {
|
||||
continue
|
||||
}
|
||||
diff.Attributes[k] = &ResourceAttrDiff{
|
||||
Old: "",
|
||||
NewComputed: true,
|
||||
|
|
Loading…
Reference in New Issue