-
Notifications
You must be signed in to change notification settings - Fork 881
docs: describe workspace tags #13352
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
Conversation
examples/workspace-tags/main.tf
Outdated
data "coder_workspace_tags" "custom_workspace_tags" { | ||
tags = { | ||
"zone" = "developers" | ||
"os" = data.coder_parameter.os_selector.value | ||
"project_id" = "PROJECT_${data.coder_parameter.project_name.value}" | ||
"cache" = data.coder_parameter.feature_cache_enabled.value == "true" ? "with-cache" : "no-cache" | ||
} | ||
} | ||
|
||
data "coder_parameter" "os_selector" { | ||
name = "os_selector" | ||
display_name = "OS runtime" | ||
default = "linux" | ||
|
||
option { | ||
name = "Linux" | ||
value = "linux" | ||
} | ||
option { | ||
name = "OSX" | ||
value = "osx" | ||
} | ||
option { | ||
name = "Windows" | ||
value = "windows" | ||
} | ||
|
||
mutable = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain if data.coder_parameter.os_selector
represents the os of the workspace being provisioned? This example confuses me in understanding the purpose and benefits of using workspace_tags
. If yes, then the code-server
and the docker_container
can only run on a Linux host. This feels incomplete on how a template can provide a workspace with three different OS using the new functionality and external-provisioners.
As this will also be published as an official example on https://registry.coder.com/templates, we should try to make the tags as practical as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove the example altogether, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed the os_selector
to runtime_selector
, so it might be easier to comprehend that is about selecting either a free zone or an isolated, secure, air-gapped environment. I hope it makes it clear.
BTW I can modify it to depend on "foobars" too. My intention was to indicate the syntax rather providing use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better. But my opinion is that we should remove the example altogether if it is not usable out of the box. The docs are written well enough to serve the users who actually need to use this feature.
docs/manifest.json
Outdated
@@ -200,6 +200,11 @@ | |||
"description": "Prompt the template administrator for additional information about a template", | |||
"path": "./templates/variables.md" | |||
}, | |||
{ | |||
"title": "Workspace Tags", | |||
"description": "Select provisioners using Coder Parameters", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SEO suggestion:
"description": "Select provisioners using Coder Parameters", | |
"description": "Control provisioning using Workspace Tags and Parameters", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good hint!
@johnstcn To dogfood this, I suggest we run provisioners on all dogfood regions and use |
@matifali I'm happy to discuss improvements in docs, examples, and product expectations once you're back from PTO. It is hard to chat about plans here. |
Filed https://github.com/coder/dogfood/issues/77 to follow up. |
Fixes: #13221
This PR adds the doc page for
coder_workspace_tags
describing the feature, its limitations, and a few samples.Note:
If I can't merge it due to the links-checker reporting invalid URLs, I will open a separate PR for the example.