remove NormalizeObjectFromLegacySDK from diff

The NormalizeObjectFromLegacySDK calls have been moved into the
provider shims, so all objects generated by the provider should conform
now.
This commit is contained in:
James Bardin 2019-03-06 16:21:32 -05:00
parent 209a0a460a
commit 5c40d6610c
1 changed files with 0 additions and 10 deletions

View File

@ -122,16 +122,6 @@ func ResourceChange(
panic(fmt.Sprintf("failed to decode plan for %s while rendering diff: %s", addr, err)) panic(fmt.Sprintf("failed to decode plan for %s while rendering diff: %s", addr, err))
} }
// We currently have an opt-out that permits the legacy SDK to return values
// that defy our usual conventions around handling of nesting blocks. To
// avoid the rendering code from needing to handle all of these, we'll
// normalize first.
// (Ideally we'd do this as part of the SDK opt-out implementation in core,
// but we've added it here for now to reduce risk of unexpected impacts
// on other code in core.)
changeV.Change.Before = objchange.NormalizeObjectFromLegacySDK(changeV.Change.Before, schema)
changeV.Change.After = objchange.NormalizeObjectFromLegacySDK(changeV.Change.After, schema)
bodyWritten := p.writeBlockBodyDiff(schema, changeV.Before, changeV.After, 6, path) bodyWritten := p.writeBlockBodyDiff(schema, changeV.Before, changeV.After, 6, path)
if bodyWritten { if bodyWritten {
buf.WriteString("\n") buf.WriteString("\n")