Skip to content

Commit cae63eb

Browse files
committed
force strings in default values
1 parent 2ba0095 commit cae63eb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

paramhook.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ func evaluateCoderParameterDefault(b *terraform.Block) (cty.Value, hcl.Diagnosti
8383
valType = cty.String
8484
}
8585

86+
// TODO: We should support different tf types, but at present the tf
87+
// schema is static. So only string is allowed
88+
valType = cty.String
89+
8690
var val cty.Value
8791

8892
def, exists := attributes["default"]
@@ -115,5 +119,4 @@ func evaluateCoderParameterDefault(b *terraform.Block) (cty.Value, hcl.Diagnosti
115119
}
116120

117121
return val, nil
118-
119122
}

testdata/conditional/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ data "coder_parameter" "favorite" {
7676
name = "Favorite number"
7777
description = "What is your favorite number?"
7878
type = "number"
79-
default = 0
79+
default = "5"
8080
order = 3
81+
8182
validation {
8283
min=0
8384
max=9

0 commit comments

Comments
 (0)