Open
Description
Given a parameter with a choice, when creating a Workspace, if the user deletes the default value in the field, in this example from "0"
to ""
data "coder_parameter" "home_data_disk_size" {
type = "number"
name = "Additional Home Data Volume Size"
mutable = true
default = 0
validation {
min = 0
max = 2048
monotonic = "increasing"
}
}
You get this error when the Terraform runs:
Error: value "" is not a number
on .terraform/modules/platform_eng/data.tf line 487, in data "coder_parameter" "home_data_disk_size":
487: data "coder_parameter" "home_data_disk_size" {
I believe this should be validated when in the wizard instead. Either that or provide something like a boolean attribute in the coder_parameter
schema for an option like non_empty
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
stirby commentedon Mar 6, 2025
This is an excellent use case for our coder preview engine. We have a lot of areas to cover with error handling but we want to expose these earlier. Both in the workspace creation screen and when testing templates locally.
This becomes a larger headache as we allow parameter conditionality.
matifali commentedon May 27, 2025
@Emyrk, would this be handled now with dynamic parameters?
Emyrk commentedon May 27, 2025
@matifali If I understand correctly, then yes.
Dynamic params will show an empty form input, and have a
required
mark. The user must provide a value before submitting.