Structured Plan Renderer: Read the data source schemas from the right place (#32532)

* read the data source schemas from the right place

* address comments and add test
This commit is contained in:
Liam Cervante
2023-01-19 15:37:02 +01:00
committed by GitHub
parent 7a019fa767
commit 6dc49150b7
5 changed files with 141 additions and 6 deletions

View File

@@ -43,7 +43,7 @@ func precomputeDiffs(plan Plan, mode plans.Mode) diffs {
continue
}
schema := plan.ProviderSchemas[drift.ProviderName].ResourceSchemas[drift.Type]
schema := plan.GetSchema(drift)
diffs.drift = append(diffs.drift, diff{
change: drift,
diff: differ.FromJsonChange(drift.Change, relevantAttrs).ComputeDiffForBlock(schema.Block),
@@ -51,7 +51,7 @@ func precomputeDiffs(plan Plan, mode plans.Mode) diffs {
}
for _, change := range plan.ResourceChanges {
schema := plan.ProviderSchemas[change.ProviderName].ResourceSchemas[change.Type]
schema := plan.GetSchema(change)
diffs.changes = append(diffs.changes, diff{
change: change,
diff: differ.FromJsonChange(change.Change, attribute_path.AlwaysMatcher()).ComputeDiffForBlock(schema.Block),