Skip to content

Commit 63e4228

Browse files
authored
chore: Update templates from Always to IfNotPresent for image_pull_policy (#501)
## Description Change `image_pull_policy` from `Always` to `IfNotPresent` on Coder owned templates. Given these are a reference point for users and customers and they copy them into their own templates I think it makes sense to encourage the use of caching of images. ## Type of Change - [ ] New module - [ ] New template - [ ] Bug fix - [x] Feature/enhancement - [ ] Documentation - [ ] Other ## Template Information **Path:** https://github.com/coder/registry/tree/main/registry/coder/templates/kubernetes-devcontainer https://github.com/coder/registry/tree/main/registry/coder/templates/kubernetes-envbox https://github.com/coder/registry/tree/main/registry/coder/templates/kubernetes ## Testing & Validation - [ ] Tests pass (`bun test`) - [ ] Code formatted (`bun fmt`) - [x] Changes tested locally ## Related Issues None
1 parent 0c5a8a2 commit 63e4228

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

registry/coder/templates/kubernetes-devcontainer/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ resource "kubernetes_deployment" "main" {
264264
container {
265265
name = "dev"
266266
image = var.cache_repo == "" ? local.devcontainer_builder_image : envbuilder_cached_image.cached.0.image
267-
image_pull_policy = "Always"
267+
image_pull_policy = "IfNotPresent"
268268
security_context {
269269
privileged = true
270270
}
@@ -455,4 +455,4 @@ resource "coder_metadata" "container_info" {
455455
key = "cache repo"
456456
value = var.cache_repo == "" ? "not enabled" : var.cache_repo
457457
}
458-
}
458+
}

registry/coder/templates/kubernetes-envbox/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ resource "kubernetes_pod" "main" {
152152
name = "dev"
153153
# We highly recommend pinning this to a specific release of envbox, as the latest tag may change.
154154
image = "ghcr.io/coder/envbox:latest"
155-
image_pull_policy = "Always"
155+
image_pull_policy = "IfNotPresent"
156156
command = ["/envbox", "docker"]
157157

158158
security_context {
@@ -310,4 +310,4 @@ resource "kubernetes_pod" "main" {
310310
}
311311
}
312312
}
313-
}
313+
}

registry/coder/templates/kubernetes/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ resource "kubernetes_deployment" "main" {
287287
container {
288288
name = "dev"
289289
image = "codercom/enterprise-base:ubuntu"
290-
image_pull_policy = "Always"
290+
image_pull_policy = "IfNotPresent"
291291
command = ["sh", "-c", coder_agent.main.init_script]
292292
security_context {
293293
run_as_user = "1000"

0 commit comments

Comments
 (0)