e8ccdbfa by Adam Heath

Add a macro to help with image settings.

1 parent 70cf125d
......@@ -69,6 +69,11 @@ Create the name of the service account to use
{{- end }}
{{- end }}
{{- define "moqui.image-helper" -}}
image: "{{ if .registry }}{{ .registry }}/{{ end }}{{ .repository }}{{ if .tag }}:{{ .tag }}{{ end }}"
imagePullPolicy: {{ .pullPolicy }}
{{- end }}
{{- define "moqui.entity_ds_host" -}}
{{- if (and (eq .Values.configMap.entity_ds_db_conf "postgres") .Values.postgresql.enabled) }}
{{- include "postgresql.primary.svc.headless" .Subcharts.postgresql }}
......
......@@ -39,8 +39,7 @@ spec:
{{- if (eq .Values.configMap.entity_ds_db_conf "postgres") }}
{{- if .Values.postgresql.jdbcImage.enabled }}
- name: postgresql-copy-jdbc
image: "{{ .Values.postgresql.jdbcImage.repository }}:{{ .Values.postgresql.jdbcImage.tag }}"
imagePullPolicy: {{ .Values.postgresql.jdbcImage.pullPolicy }}
{{ include "moqui.image-helper" .Values.postgresql.jdbcImage | nindent 10 }}
command:
- bash
- -cx
......@@ -52,8 +51,7 @@ spec:
{{- end }}
{{- if (.Values.checkDsConnection.enabled) }}
- name: postgresql-check-connection
image: "{{ .Values.postgresql.image.registry }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}"
imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}
{{ include "moqui.image-helper" .Values.postgresql.image | nindent 10 }}
env:
- name: POSTGRES_HOST
value: {{ include "moqui.entity_ds_host" . }}
......@@ -75,8 +73,7 @@ spec:
{{- define "moqui-container-pod" }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{ include "moqui.image-helper" .Values.image | nindent 10 }}
command: ["java", "-server", "-XX:-OmitStackTraceInFastThrow", "-cp", ".", "MoquiStart"]
envFrom:
- configMapRef:
......