mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #19522 from hashicorp/mildwonkey/b-plan-msgpack
backend/local: decode variables with cty.DynamicPseudoType
This commit is contained in:
commit
69c647c3dc
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/hashicorp/terraform/states/statemgr"
|
"github.com/hashicorp/terraform/states/statemgr"
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/terraform"
|
||||||
"github.com/hashicorp/terraform/tfdiags"
|
"github.com/hashicorp/terraform/tfdiags"
|
||||||
|
"github.com/zclconf/go-cty/cty"
|
||||||
)
|
)
|
||||||
|
|
||||||
// backend.Local implementation.
|
// backend.Local implementation.
|
||||||
@ -219,16 +220,7 @@ func (b *Local) contextFromPlanFile(pf *planfile.Reader, opts terraform.ContextO
|
|||||||
|
|
||||||
variables := terraform.InputValues{}
|
variables := terraform.InputValues{}
|
||||||
for name, dyVal := range plan.VariableValues {
|
for name, dyVal := range plan.VariableValues {
|
||||||
ty, err := dyVal.ImpliedType()
|
val, err := dyVal.Decode(cty.DynamicPseudoType)
|
||||||
if err != nil {
|
|
||||||
diags = diags.Append(tfdiags.Sourceless(
|
|
||||||
tfdiags.Error,
|
|
||||||
errSummary,
|
|
||||||
fmt.Sprintf("Invalid value for variable %q recorded in plan file: %s.", name, err),
|
|
||||||
))
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
val, err := dyVal.Decode(ty)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
diags = diags.Append(tfdiags.Sourceless(
|
diags = diags.Append(tfdiags.Sourceless(
|
||||||
tfdiags.Error,
|
tfdiags.Error,
|
||||||
|
Loading…
Reference in New Issue
Block a user