-
Notifications
You must be signed in to change notification settings - Fork 881
tagged provisioners started with --key
do not pick up jobs tagged by coder_workspace
data source
#15047
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
Comments
@stirby Let's look out for this one and do a patch once completed |
@dannykopping let's sync up on this! |
So unfortunately this is actually "expected behavior" for provisioners and tags, and is a limitation of how the terraform datasources are imported. What's happening:
A workaround would be to run an untagged provisioner to handle the original template import job where it transitions from untagged to tagged. After the template is tagged future changes to the template and workspaces created from it should be picked up correctly. The other option would be to tag the template version in the UI first then add the This seems to come down to an unexpected behavior with the This is obviously confusing to the end user and should be improved, but there's not an obvious answer to solve this with our current provisioner and template architecture. Some ideas:
|
Some more clarifying information:
So this behavior has actually be incorrect for ~5 months, but we just haven't had customers hit these edge cases or they have and haven't noticed because nothing is visibly broken, just maybe provisioned incorrectly. |
Thanks for the write-up. I think it would be totally acceptable for template versions to provision without these tags. However, I am assuming we also need to solve this problem for workspace builds too? |
I am noticing, even when the template is pushed the workspace build gets assigned to the wrong tags too... Just just a template thing |
So the answer to the original bug report of "I run a provisioner with a key with tags and it isn't picking up this template that specifies tags in the HCL" with "That HCL doesn't apply to template import jobs". For template import jobs you would essentially need a pool of untagged provisioners or you would need to add the tags to the template versions themselves outside of the HCL. This is why we just ran into issues with this with orgs, because new orgs do not have For workspace builds, we basically should not be introspecting terraform values from coderd, but it's currently the only way to support using coder parameters in the |
So does this work as expected for workspace builds (assigning to proper provisioner tags)? This did not happen in my testing |
Edit: I confirmed it works as expected with workspace |
It was a deliberate design decision to define It's definitely a bug that we don't process This does double-down on HCL and terraform, rather than being entirely agnostic to the provisioner, but I think that's the price we pay to allow template authors to define tags "in-line" with The only alternative I can see is a full redesign of the feature, that deprecates |
…15081) Relates to #15047 --------- Co-authored-by: Edward Angert <[email protected]>
We're going to do the more expensive fix.
Closing in favor of #15427, which tracks this |
Steps to reproduce
Create a key for a tagged provisioner in a separate org
Start the provisioner with the key
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
Modify an existing template to add tags to the template

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)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.
Notice that starting an un-tagged provisioner will allow this build to complete
Observe that this also applies to workspaces started with templates with
coder_workspace_tags
. The tags seem to do nothingTo summarize
coder_workspace_tags
data source (example template) is designed to dynamically assign provisioner tags to a template--key
. Instead, the jobs seem to apply as if no tags are set, both for the workspace build and template version pushstarting provisioner daemon tags={}
The text was updated successfully, but these errors were encountered: