use dynamic types when handling variables during plan and show static evaluation (#1826)

Signed-off-by: James Humphries <james@james-humphries.co.uk>
This commit is contained in:
James Humphries
2024-07-17 16:46:24 +01:00
committed by GitHub
parent b93acf96a9
commit cc91bf25f5
5 changed files with 129 additions and 97 deletions

View File

@@ -13,6 +13,8 @@ import (
"strings"
"github.com/hashicorp/hcl/v2"
"github.com/zclconf/go-cty/cty"
"github.com/opentofu/opentofu/internal/backend"
"github.com/opentofu/opentofu/internal/cloud"
"github.com/opentofu/opentofu/internal/cloud/cloudplan"
@@ -27,7 +29,6 @@ import (
"github.com/opentofu/opentofu/internal/tfdiags"
"github.com/opentofu/opentofu/internal/tofu"
"github.com/opentofu/opentofu/internal/tofumigrate"
"github.com/zclconf/go-cty/cty"
)
// Many of the methods we get data from can emit special error types if they're
@@ -382,7 +383,7 @@ func getDataFromPlanfileReader(planReader *planfile.Reader, rootCall configs.Sta
return variable.Default, nil
}
parsed, parsedErr := v.Decode(variable.Type)
parsed, parsedErr := v.Decode(cty.DynamicPseudoType)
if parsedErr != nil {
diags = diags.Append(&hcl.Diagnostic{
Severity: hcl.DiagError,