Skip to content

Commit a029b3e

Browse files
Allow override of specific image repositories
1 parent e07acb2 commit a029b3e

7 files changed

Lines changed: 40 additions & 4 deletions

File tree

chart/templates/_helpers.tpl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,19 @@ Check if public URL uses HTTPS
559559
true
560560
{{- end -}}
561561
{{- end }}
562+
563+
{{/*
564+
Get image repository for a component
565+
Expected dict: { "root": $, "component": "app" }
566+
Returns the repository to use, either component-specific or global
567+
*/}}
568+
{{- define "openops.imageRepository" -}}
569+
{{- $root := .root -}}
570+
{{- $component := .component -}}
571+
{{- $componentConfig := index $root.Values $component -}}
572+
{{- if and $componentConfig.repository (ne $componentConfig.repository "") -}}
573+
{{- $componentConfig.repository -}}
574+
{{- else -}}
575+
{{- $root.Values.image.repository -}}
576+
{{- end -}}
577+
{{- end }}

chart/templates/deployment-analytics.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ spec:
4747
{{- include "openops.initContainers" (dict "root" . "component" "analytics") | nindent 6 }}
4848
containers:
4949
- name: {{ .Values.analytics.name }}
50-
image: "{{ .Values.image.repository }}/{{ .Values.analytics.image }}:{{ .Values.analytics.tag }}"
50+
image: "{{ include "openops.imageRepository" (dict "root" . "component" "analytics") }}/{{ .Values.analytics.image }}:{{ .Values.analytics.tag }}"
5151
imagePullPolicy: {{ .Values.image.pullPolicy }}
5252
{{- include "openops.containerSecurityContext" (dict "root" .) | nindent 8 }}
5353
env:

chart/templates/deployment-app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ spec:
5151
{{- include "openops.initContainers" (dict "root" . "component" "app") | nindent 6 }}
5252
containers:
5353
- name: {{ .Values.app.name }}
54-
image: "{{ .Values.image.repository }}/{{ .Values.app.image }}:{{ .Values.global.version }}"
54+
image: "{{ include "openops.imageRepository" (dict "root" . "component" "app") }}/{{ .Values.app.image }}:{{ .Values.global.version }}"
5555
imagePullPolicy: {{ .Values.image.pullPolicy }}
5656
{{- if .Values.global.containerSecurityContext.enabled }}
5757
securityContext:

chart/templates/deployment-engine.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ spec:
4747
{{- include "openops.initContainers" (dict "root" . "component" "engine") | nindent 6 }}
4848
containers:
4949
- name: {{ .Values.engine.name }}
50-
image: "{{ .Values.image.repository }}/{{ .Values.engine.image }}:{{ .Values.global.version }}"
50+
image: "{{ include "openops.imageRepository" (dict "root" . "component" "engine") }}/{{ .Values.engine.image }}:{{ .Values.global.version }}"
5151
imagePullPolicy: {{ .Values.image.pullPolicy }}
5252
{{- include "openops.containerSecurityContext" (dict "root" .) | nindent 10 }}
5353
command: [ "/bin/sh", "-c", "cp -r /var/tmp-base/. /tmp/ && node main.js" ]

chart/templates/deployment-tables.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ spec:
4949
{{- include "openops.initContainers" (dict "root" . "component" "tables") | nindent 6 }}
5050
containers:
5151
- name: {{ .Values.tables.name }}
52-
image: "{{ .Values.image.repository }}/{{ .Values.tables.image }}:{{ .Values.tables.tag }}"
52+
image: "{{ include "openops.imageRepository" (dict "root" . "component" "tables") }}/{{ .Values.tables.image }}:{{ .Values.tables.tag }}"
5353
imagePullPolicy: {{ .Values.image.pullPolicy }}
5454
{{- if .Values.global.containerSecurityContext.enabled }}
5555
securityContext:

chart/values.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
"image": {
4646
"type": "string"
4747
},
48+
"repository": {
49+
"type": "string",
50+
"description": "Override global image.repository for app (empty = use global)"
51+
},
4852
"replicas": {
4953
"type": "integer",
5054
"minimum": 0
@@ -61,6 +65,10 @@
6165
"image": {
6266
"type": "string"
6367
},
68+
"repository": {
69+
"type": "string",
70+
"description": "Override global image.repository for engine (empty = use global)"
71+
},
6472
"replicas": {
6573
"type": "integer",
6674
"minimum": 0
@@ -77,6 +85,10 @@
7785
"image": {
7886
"type": "string"
7987
},
88+
"repository": {
89+
"type": "string",
90+
"description": "Image repository for tables (defaults to public.ecr.aws/openops)"
91+
},
8092
"tag": {
8193
"type": "string",
8294
"description": "Immutable version tag for tables image",
@@ -98,6 +110,10 @@
98110
"image": {
99111
"type": "string"
100112
},
113+
"repository": {
114+
"type": "string",
115+
"description": "Image repository for analytics (defaults to public.ecr.aws/openops)"
116+
},
101117
"tag": {
102118
"type": "string",
103119
"description": "Immutable version tag for analytics image",

chart/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ secretEnv:
164164
app:
165165
name: openops-app
166166
image: openops-app
167+
repository: "" # Override global image.repository (empty = use global)
167168
replicas: 2 # Minimum 2 for high availability
168169
resources:
169170
requests:
@@ -199,6 +200,7 @@ app:
199200
engine:
200201
name: openops-engine
201202
image: openops-engine
203+
repository: "" # Override global image.repository (empty = use global)
202204
replicas: 2 # Minimum 2 for high availability
203205
resources:
204206
requests:
@@ -237,6 +239,7 @@ engine:
237239
tables:
238240
name: openops-tables
239241
image: openops-tables
242+
repository: "public.ecr.aws/openops" # Always use public ECR for tables
240243
tag: "0.2.17"
241244
replicas: 1
242245
resources:
@@ -299,6 +302,7 @@ tables:
299302
analytics:
300303
name: openops-analytics
301304
image: openops-analytics
305+
repository: "public.ecr.aws/openops" # Always use public ECR for analytics
302306
tag: "0.14.4"
303307
replicas: 1
304308
resources:

0 commit comments

Comments
 (0)