Skip to content

Commit a85a3e0

Browse files
fix: global registry overwrite
1 parent d266399 commit a85a3e0

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

templates/_helpers.tpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,15 @@ Common annotations
252252
{{ toYaml . }}
253253
{{- end }}
254254
{{- end }}
255+
256+
{{/*
257+
Return the proper init container image name (busybox)
258+
*/}}
259+
{{- define "patchmon.initContainer.image" -}}
260+
{{- $registry := .Values.global.imageRegistry -}}
261+
{{- if $registry -}}
262+
{{- printf "%s/busybox:latest" $registry -}}
263+
{{- else -}}
264+
busybox:latest
265+
{{- end -}}
266+
{{- end -}}

templates/backend-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
initContainers:
4242
{{- if and .Values.backend.initContainers.waitForDatabase.enabled .Values.database.enabled }}
4343
- name: wait-for-database
44-
image: busybox:latest
44+
image: {{ include "patchmon.initContainer.image" . }}
4545
command:
4646
- sh
4747
- "-c"
@@ -56,7 +56,7 @@ spec:
5656
{{- end }}
5757
{{- if and .Values.backend.initContainers.waitForRedis.enabled .Values.redis.enabled }}
5858
- name: wait-for-redis
59-
image: busybox:latest
59+
image: {{ include "patchmon.initContainer.image" . }}
6060
command:
6161
- sh
6262
- "-c"
@@ -71,7 +71,7 @@ spec:
7171
{{- end }}
7272
{{- if .Values.backend.initContainers.fixPermissions.enabled }}
7373
- name: fix-permissions
74-
image: busybox:latest
74+
image: {{ include "patchmon.initContainer.image" . }}
7575
command:
7676
- sh
7777
- "-c"

templates/frontend-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
initContainers:
4242
{{- if and .Values.frontend.initContainers.waitForBackend.enabled .Values.backend.enabled }}
4343
- name: wait-for-backend
44-
image: busybox:latest
44+
image: {{ include "patchmon.initContainer.image" . }}
4545
command:
4646
- sh
4747
- "-c"

values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ commonAnnotations: {}
2525
database:
2626
enabled: true
2727
image:
28-
registry: docker.io
28+
registry: ""
2929
repository: postgres
3030
tag: "18-alpine"
3131
pullPolicy: IfNotPresent
@@ -115,7 +115,7 @@ database:
115115
redis:
116116
enabled: true
117117
image:
118-
registry: docker.io
118+
registry: ""
119119
repository: redis
120120
tag: "8-alpine"
121121
pullPolicy: IfNotPresent
@@ -203,7 +203,7 @@ redis:
203203
backend:
204204
enabled: true
205205
image:
206-
registry: ghcr.io
206+
registry: ""
207207
repository: patchmon/patchmon-backend
208208
tag: 1.3.7
209209
pullPolicy: Always
@@ -339,7 +339,7 @@ backend:
339339
frontend:
340340
enabled: true
341341
image:
342-
registry: ghcr.io
342+
registry: ""
343343
repository: patchmon/patchmon-frontend
344344
tag: 1.3.7
345345
pullPolicy: IfNotPresent

0 commit comments

Comments
 (0)