Skip to content

Commit

Permalink
Only include provider-defined functions for Terraform >= 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck authored and ansgarm committed Apr 3, 2024
1 parent 3b452ca commit 26bfa1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions schema/core_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
v1_5 = version.Must(version.NewVersion("1.5"))
v1_6 = version.Must(version.NewVersion("1.6"))
v1_7 = version.Must(version.NewVersion("1.7"))
v1_8 = version.Must(version.NewVersion("1.8"))
)

// CoreModuleSchemaForVersion finds a module schema which is relevant
Expand Down
4 changes: 4 additions & 0 deletions schema/functions_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (m *FunctionsMerger) FunctionsForModule(meta *tfmod.Meta) (map[string]schem
return m.coreFunctions, nil
}

if m.terraformVersion.LessThan(v1_8) {
return m.coreFunctions, nil
}

mergedFunctions := make(map[string]schema.FunctionSignature, len(m.coreFunctions))
for fName, fSig := range m.coreFunctions {
mergedFunctions[fName] = *fSig.Copy()
Expand Down

0 comments on commit 26bfa1c

Please sign in to comment.