Comments (9)
@matifali I suppose that's an option, although terraform doesn't have any better idea of what version of the agent is truly going to run. So I think checking the deployment version is a good approximation (ideally, latest agent should be downloaded on start).
I don't have any strong opinions on that, though.
One simple change we definitely can make is expose a CODER_{MODULE_}AGENT_VERSION=v1.0.0
env that's always present in scripts. This can be used for primary or additional verification, or handling fallbacks.
from modules.
@kylecarbs any thoughts on how we can do this?
My idea is to add a property to such modules let's say MINIMUM_CODER_VERSION="2.6.0"
and then check during run.sh
execution if the coder version is satisfied.
We could probably do this in Terraform, too, if we have a way to get the coder version in Terraform.
from modules.
@mafredri what are you doing thoughts on this? See my comment above.
from modules.
Don't we already do this? For example:
Lines 4 to 9 in a9a58bf
I think the best place for this is terraform, since runtime (script) failure means late detection of issues / non-functional workspace after build.
from modules.
@mafredri This Coder provider. We are talking about the Coder version. e.g. v2.7.2
An example is a module that depends on the coder agent env set
command(when added). It should fail if added to older Coder deployments
from modules.
@matifali Ah, I see.
I'd say, the coder
terraform provider could expose coder version and we could validate that in the module. It'd be nice to represent this in a way where we can easily expose the information in the registry too.
We could add a new data source, like coder_deployment
:
coder_deployment "me" {}
something {
lifecycle {
postcondition {
condition = check_version(coder_deployment.me.version)
error_message = "Coder deployment version must be higher than XXX."
}
}
}
Or maybe it can be a separate resource with param, like:
resource "coder_deployment" "some_module" {
require_version = ">=1.0.0"
}
from modules.
@mafredri Hmm or something we can add to coder_workspace or the agent. As the scripts are being run by the agent so something like coder_agent.example.version
or data.coder-workspace.me.coder_version
and then used along with
something {
lifecycle {
postcondition {
condition = check_version(coder_agent.example.version)
error_message = "Coder deployment version must be higher than XXX."
}
}
}
from modules.
@mafredri Exposing is not a problem I think. We can already get the version within a script using something like coder version | head -n 1 | awk '{print $2}' | awk -F"-" '{print $1}' | sed 's/v//'
I am wondering if it's ok to do it in scripts or if we should/can do it in Terraform. The benefit of doing it in Terraform is we can fail at build stage instead of the coder_script.
from modules.
Can we have this built-in to the coder provider? For example to use coder provider v0.17.0 one needs to be on Coder version 2.8.3+.
The idea is that installing provider will fail if run on a lower version of Coder with an actionable error message in template build logs.
from modules.
Related Issues (20)
- feat(code-server): option to auto-install recommended extensions from `extensions.json`
- JetBrains-Gateway: coder_parameter order can not be set
- jfrog: make configuring CLI and package managers optional
- rfc(git-clone): add support for pull request and merge request urls HOT 2
- feat(git-clone): add support for tree git clone url
- feat(Jetbrains-Gateway): Specify IDE Version or Latest HOT 15
- feat(Dotfiles): Default Repo HOT 11
- feat(jetbrains-gateway): prepare for `2024.1` release
- registry.coder.com shows wrong version HOT 4
- Jetbrains-Gatway: Launcher Metadata
- Web RDP module with devolutions-gateway HOT 2
- Add password to coder_apps that support it
- JFrog xray scanning module to list workspace image vulnerabilities
- JetBrains Fleet: Add a 1-click button for launching Fleet HOT 9
- problems with validation for jetbrains gateway module folder HOT 2
- fix(code-server): add extensions to be auto-installed even when a cached copy of coder is found HOT 1
- Allow coder modules to automatically install devcontainer customizations
- update git-config module to use `coder_workspace_owner`
- coder-login module page is 404 HOT 3
- git clone module errors on empty repository
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modules.