C
Coder.com•2mo ago
jay

Template using old version of parameters

I have a template (basically this one here - https://registry.coder.com/templates/gcp-devcontainer) that I updated. In an older version I was using a specific repo. In my latest version (which is set as active) I am using a different repo as source for the devcontainer. I have changed the repo to be a TF variable to make it immutable by the user. Problem is, that when I create a workspace, the old repo is being picked up. Any ideas?
14 Replies
Codercord
Codercord•2mo ago
<#1343926124731830424>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
jay
jayOP•2mo ago
As a sidequest - is there a way to delete old versions of a template without the need to delete the whole template?
sharkymark
sharkymark•2mo ago
on #2 using coder CLI, coder templates archive <template_name> <version> https://coder.com/docs/reference/cli/templates_versions_archive
templates versions archive | Coder Docs
Archive a template version(s).
From An unknown user
From An unknown user
Phorcys
Phorcys•2mo ago
have you promoted the latest version to be the active one? could you send a screenshot of your template's versions tab?
jay
jayOP•2mo ago
No description
jay
jayOP•2mo ago
variable "repo_url" { default = "https://github.com/myOrgHere/myRepoHere" description = "Repository URL" type = string } This is the thing. It has a differing default in both templates but the old one is taken - even when scaffolding a workspace with the new template version.
Phorcys
Phorcys•2mo ago
are you expecting this change to be seen by the user when creating a workspace? variables are set by the template administrator inside the template settings, users don't have access to edit them when creating a workspace
Phorcys
Phorcys•2mo ago
would you be able to check that the version is the latest here?
No description
jay
jayOP•2mo ago
I am the admin. I have created the new template version because it should pull the devcontainer sources from another repo. Because of that I changed the default on the var - so the user has no saying in what is being created. But it is picking up the value from the old template version when I create a new workspace with the new template version. I can confirm that when creating the workspace, I am using the newest version that is also marked as active. I would not be confused if it were different 😄 Okay. I did read your last post a few times @Phorcys because there was something about it. Error seems to be between keyboard and chair. There IS a (quite hidden) settings page, where I can set the variables and sure enough it had old values in there. I am wondering however, why this is not as prominent as the other tabs where I can modify relevant template settings. Will experiment a bit how the values ended there in the first place but my best guess is that they were coder values instead of terraform ones during my first template iterations. TLDR - user error and TYVM @Phorcys !
Phorcys
Phorcys•2mo ago
just to understand a bit better, what's the difference between "coder values" and "terraform values" to you in this context? i'd like to see how we can make it clearer in the product if something confused you
jay
jayOP•2mo ago
Difference is between using variable "devcontainer_builder" --> TF var and
jay
jayOP•2mo ago
What I meant was...
No description
Phorcys
Phorcys•2mo ago
yup, this is "intended" because everything in the dropdown is settings/admin related whereas everything in the template view is mostly viewing-related i have to admit that it might be a bit janky, it has confused me in the past multiple times i've marked this as "improvement-needed" ;-)
Codercord
Codercord•2mo ago
@Phorcys closed the thread.

Did you find this page helpful?