Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameter validation errors should happen in the wizard instead of the workspace build #333

Open
matifali opened this issue Jan 29, 2025 · 0 comments

Comments

@matifali
Copy link
Member

matifali commented Jan 29, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant