@@ -97,6 +97,12 @@ variable "cache_repo" {
97
97
type = string
98
98
}
99
99
100
+ variable "insecure_cache_repo" {
101
+ default = false
102
+ description = " Enable this option if your cache registry does not serve HTTPS."
103
+ type = bool
104
+ }
105
+
100
106
variable "cache_repo_docker_config_path" {
101
107
default = " "
102
108
description = " (Optional) Path to a docker config.json containing credentials to the provided cache repo, if required."
@@ -122,7 +128,7 @@ locals {
122
128
" ENVBUILDER_CACHE_REPO" : var.cache_repo,
123
129
" ENVBUILDER_DOCKER_CONFIG_BASE64" : try (data. local_sensitive_file . cache_repo_dockerconfigjson [0 ]. content_base64 , " " ),
124
130
" ENVBUILDER_PUSH_IMAGE" : var.cache_repo == " " ? " " : " true" ,
125
- # "ENVBUILDER_INSECURE": "true", # Uncomment if testing with an insecure registry.
131
+ " ENVBUILDER_INSECURE" : " ${ var . insecure_cache_repo } " ,
126
132
}
127
133
# Convert the above map to the format expected by the docker provider.
128
134
docker_env = [
@@ -174,7 +180,7 @@ resource "envbuilder_cached_image" "cached" {
174
180
git_url = local. repo_url
175
181
cache_repo = var. cache_repo
176
182
extra_env = local. envbuilder_env
177
- # insecure = true # Uncomment if testing with an insecure registry.
183
+ insecure = var . insecure_cache_repo
178
184
}
179
185
180
186
resource "docker_container" "workspace" {
@@ -328,7 +334,7 @@ resource "coder_app" "code-server" {
328
334
329
335
resource "coder_metadata" "container_info" {
330
336
count = data. coder_workspace . me . start_count
331
- resource_id = docker_container . workspace . 0 . id
337
+ resource_id = coder_agent . main . id
332
338
item {
333
339
key = " workspace image"
334
340
value = var. cache_repo == " " ? local. devcontainer_builder_image : envbuilder_cached_image. cached . 0 . image
0 commit comments