Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions extract/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,6 @@ func ParameterFromBlock(block *terraform.Block) (*types.Parameter, hcl.Diagnosti
}

usageDiags := ParameterUsageDiagnostics(p)
if usageDiags.HasErrors() {
p.FormType = provider.ParameterFormTypeError
}
diags = diags.Extend(usageDiags)

// Diagnostics are scoped to the parameter
Expand Down
11 changes: 11 additions & 0 deletions preview_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,17 @@ func Test_Extract(t *testing.T) {
optNames("GoLand 2024.3", "IntelliJ IDEA Ultimate 2024.3", "PyCharm Professional 2024.3"),
},
},
{
name: "unknownoption",
dir: "unknownoption",
expTags: map[string]string{},
input: preview.Input{},
unknownTags: []string{},
params: map[string]assertParam{
"unknown": apWithDiags().
errorDiagnostics("The set of options cannot be resolved"),
},
},
} {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Expand Down
37 changes: 37 additions & 0 deletions testdata/unknownoption/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# main.tf

terraform {
required_providers {
coder = {
source = "coder/coder"
version = "2.4.0-pre0"
}
docker = {
source = "kreuzwerker/docker"
version = "3.0.2"
}
}
}

data "coder_parameter" "unknown" {
name = "unknown"
display_name = "Unknown Option Example"
type = "string"
default = "foo"

option {
name = "Ubuntu"
value = data.docker_registry_image.ubuntu.sha256_digest
}

option {
name = "foo"
value = "foo"
}
}

data "docker_registry_image" "ubuntu" {
name = "ubuntu:24.04"
// sha256_digest
}

Loading