Thanks to visit codestin.com
Credit goes to github.com

Skip to content

coder_parameter regression: cannot use lists and functions anymore #16021

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

Closed
lsoica opened this issue Jan 3, 2025 · 5 comments Β· Fixed by #16023
Closed

coder_parameter regression: cannot use lists and functions anymore #16021

lsoica opened this issue Jan 3, 2025 · 5 comments Β· Fixed by #16023
Assignees
Labels
regression Something that used to work but no longer works s1 Bugs that break core workflows. Only humans may set this.

Comments

@lsoica
Copy link

lsoica commented Jan 3, 2025

The following parameter definition was valid with older coder versions but is valid anymore with coder 2.18.1 by coder templates push

data "coder_parameter" "param_name" {
  name         = "param_name"
  type         = "list(string)"
  default      = jsonencode(["1", "2", "3", "4"])
  description  = "List of ..."
  mutable      = true
}

Fails with:

evaluate default values of workspace tags: load parameter defaults: failed to evaluate coder_parameter "param_name" default value "jsonencode([\"1\", \"2\", \"3\", \"4\"])": variables.tf:121,18-102: Function calls not allowed; Functions may not be called here.

Even if I remove the jsonencode, it still fails with:

evaluate default values of workspace tags: load parameter defaults: failed to marshal coder_parameter "param_name" default value "[\"1\", \"2\", \"3\", \"4\"]" as string: only primitive types are supported - bool, number, and string
@matifali
Copy link
Member

matifali commented Jan 3, 2025

@lsoica Thanks for the report. I was able to reproduce this behavior on our latest preview build.

Could you share what is your Coder server version?

@matifali matifali added s1 Bugs that break core workflows. Only humans may set this. regression Something that used to work but no longer works and removed bug risk Prone to bugs needs-triage Issue that require triage labels Jan 3, 2025
@lsoica
Copy link
Author

lsoica commented Jan 3, 2025

Coder v2.18.1+765d99c

@johnstcn
Copy link
Member

johnstcn commented Jan 3, 2025

We shouldn't be evaluating parameters that are not referenced by the coder_workspace_tags data source.

@johnstcn
Copy link
Member

johnstcn commented Jan 3, 2025

@lsoica Thanks for reporting this promptly! I've merged a fix to our main branch and this should come out in the next patch release.

@johnstcn
Copy link
Member

johnstcn commented Jan 9, 2025

@lsoica this should be resolved in 2.18.2 which was released on Jan 7th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Something that used to work but no longer works s1 Bugs that break core workflows. Only humans may set this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants