Skip to content

Commit 3fc424c

Browse files
committed
fix compile issues
1 parent 007b2d2 commit 3fc424c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

extract/parameter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func ParameterFromBlock(block *terraform.Block) (*types.Parameter, hcl.Diagnosti
8888

8989
optBlocks := block.GetBlocks("option")
9090

91-
optionType, newFormType, err := provider.ValidateFormType(string(p.Type), len(optBlocks), p.FormType)
91+
optionType, newFormType, err := provider.ValidateFormType(provider.OptionType(p.Type), len(optBlocks), p.FormType)
9292
var _ = optionType // TODO: Should we enforce this anywhere?
9393
if err != nil {
9494
diags = diags.Append(&hcl.Diagnostic{

types/parameter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ type ParameterValidation struct {
7878

7979
// Valid takes the type of the value and the value itself and returns an error
8080
// if the value is invalid.
81-
func (v ParameterValidation) Valid(typ, value string) error {
81+
func (v ParameterValidation) Valid(typ string, value string) error {
82+
// TODO: Validate typ is the enum?
8283
// Use the provider.Validation struct to validate the value to be
8384
// consistent with the provider.
8485
return (&provider.Validation{
@@ -89,8 +90,7 @@ func (v ParameterValidation) Valid(typ, value string) error {
8990
Monotonic: orZero(v.Monotonic),
9091
Regex: orZero(v.Regex),
9192
Error: v.Error,
92-
Invalid: orZero(v.Invalid),
93-
}).Valid(typ, value)
93+
}).Valid(provider.OptionType(typ), value)
9494
}
9595

9696
type ParameterOption struct {

0 commit comments

Comments
 (0)