Skip to content

docs: remove unsupported legacy parameters #7799

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

Merged
merged 2 commits into from
Jun 3, 2023
Merged
Changes from 1 commit
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
Next Next commit
docs: unsupported legacy parameters
  • Loading branch information
mtojek committed Jun 2, 2023
commit d38bbdd389e8cf22d5665272b39c1a5ef12a3253
36 changes: 10 additions & 26 deletions docs/templates/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,37 +188,21 @@ data "coder_parameter" "project_id" {

## Legacy

Prior to Coder v0.16.0 (Jan 2023), parameters were defined via Terraform `variable` blocks. These "legacy parameters" can still be used in templates, but will be removed in May 2023.
### Legacy parameters are unsupported now

```hcl
variable "use_kubeconfig" {
sensitive = true # Template-level parameter (not editable when creating a workspace)
type = bool
description = <<-EOF
Use host kubeconfig? (true/false)
EOF
}
In Coder, workspaces using legacy parameters can't be deployed anymore. To address this, it is necessary to either remove or adjust incompatible templates.
In some cases, deleting a workspace with a hard dependency on a legacy parameter may be challenging. To cleanup unsupported workspaces, administrators are advised to take the following actions for affected templates:

variable "cpu" {
sensitive = false # User (workspace-level) parameter
description = "CPU (__ cores)"
default = 2
validation {
condition = contains([
"2",
"4",
"6",
"8"
], var.cpu)
error_message = "Invalid cpu!"
}
}
```

> ⚠️ Legacy (`variable`) parameters and rich parameters can't be used in the same template.
1. Enable the `feature_use_managed_variables` provider flag.
2. Ensure that every legacy variable block has defined missing default values, or convert it to `coder_parameter`.
3. Push the new template version using UI or CLI.
4. Update unsupported workspaces to the newest template version.
5. Delete the affected workspaces that have been updated to the newest template version.

### Migration

> ⚠️ Migration is available until v0.24.0 (Jun 2023) release.

Terraform variables shouldn't be used for workspace scoped parameters anymore, and it's recommended to convert variables to `coder_parameter` resources. To make the migration smoother, there is a special property introduced -
`legacy_variable` and `legacy_variable_name` , which can link `coder_parameter` with a legacy variable.
Copy link
Member

@matifali matifali Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also will legacy_variable and legacy_variable_name still be usable in v0.24.0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v0.24.0 they might be not really useful, but it should be fine to keep them for a while. We can also mark them as deprecated in the provider schema. Good catch, Atif 👍 I will check this next week.


Expand Down