mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #27926 from hashicorp/jbardin/apply-plan-config
check errors before using configSnap
This commit is contained in:
commit
1a71cdc132
@ -95,6 +95,10 @@ func (b *Local) context(op *backend.Operation) (*terraform.Context, *configload.
|
|||||||
}
|
}
|
||||||
log.Printf("[TRACE] backend/local: building context from plan file")
|
log.Printf("[TRACE] backend/local: building context from plan file")
|
||||||
tfCtx, configSnap, ctxDiags = b.contextFromPlanFile(op.PlanFile, opts, stateMeta)
|
tfCtx, configSnap, ctxDiags = b.contextFromPlanFile(op.PlanFile, opts, stateMeta)
|
||||||
|
if ctxDiags.HasErrors() {
|
||||||
|
return nil, nil, nil, ctxDiags
|
||||||
|
}
|
||||||
|
|
||||||
// Write sources into the cache of the main loader so that they are
|
// Write sources into the cache of the main loader so that they are
|
||||||
// available if we need to generate diagnostic message snippets.
|
// available if we need to generate diagnostic message snippets.
|
||||||
op.ConfigLoader.ImportSourcesFromSnapshot(configSnap)
|
op.ConfigLoader.ImportSourcesFromSnapshot(configSnap)
|
||||||
|
Loading…
Reference in New Issue
Block a user