--key
do not pick up jobs tagged by coder_workspace
data source#15047Description
Steps to reproduce
-
Create a key for a tagged provisioner in a separate org
coder provisioner keys create my-key \ --org data-platform \ --tag environment=kubernetes
-
Start the provisioner with the key
coder provisioner start --key <the-generated-key-value>
-
Observe that the provisioner does not properly report that it is starting with the tags
[info] note: untagged provisioners can only pick up jobs from untagged templates [info] provisioner key auth automatically sets tag scope empty [info] starting provisioner daemon tags={} name=bens-m2
🐛 This is bug 1. There is a second one too
-
Observe that this actually works fine and is assigned to the proper provisioner ✅
-
Remove the manual tag from the template and switch to the
coder_workspace_tags
data source (example template)data "coder_workspace_tags" "custom_workspace_tags" { tags = { "environment" = "kubernetes" } }
Screen.Recording.2024-10-12.at.8.07.11.AM.mov
-
Notice that this does not assign the job to the proper provisioner. If you have a generic provisioner with no tags, the job may be assigned to that but it is definitely not attached to the provisioner we just started.
🐛 This is bug number 2.
-
Notice that starting an un-tagged provisioner will allow this build to complete
coder login # as user with Owner role coder provisioner start --org <your-org>
-
Observe that this also applies to workspaces started with templates with
coder_workspace_tags
. The tags seem to do nothing
To summarize
- The
coder_workspace_tags
data source (example template) is designed to dynamically assign provisioner tags to a template - The way templates/workspaces are assigned to specific provisioners is documented here
- 🐛 This does not seem to work when the provisioner is started with
--key
. Instead, the jobs seem to apply as if no tags are set, both for the workspace build and template version push - 🐛 When starting a provisioner key with tags, it does not report that tags it is started with and is instead empty
starting provisioner daemon tags={}