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 ...@@ -69,6 +69,11 @@ Create the name of the service account to use
69 {{- end }} 69 {{- end }}
70 {{- end }} 70 {{- end }}
71 71
72 {{- define "moqui.image-helper" -}}
73 image: "{{ if .registry }}{{ .registry }}/{{ end }}{{ .repository }}{{ if .tag }}:{{ .tag }}{{ end }}"
74 imagePullPolicy: {{ .pullPolicy }}
75 {{- end }}
76
72 {{- define "moqui.entity_ds_host" -}} 77 {{- define "moqui.entity_ds_host" -}}
73 {{- if (and (eq .Values.configMap.entity_ds_db_conf "postgres") .Values.postgresql.enabled) }} 78 {{- if (and (eq .Values.configMap.entity_ds_db_conf "postgres") .Values.postgresql.enabled) }}
74 {{- include "postgresql.primary.svc.headless" .Subcharts.postgresql }} 79 {{- include "postgresql.primary.svc.headless" .Subcharts.postgresql }}
......
...@@ -39,8 +39,7 @@ spec: ...@@ -39,8 +39,7 @@ spec:
39 {{- if (eq .Values.configMap.entity_ds_db_conf "postgres") }} 39 {{- if (eq .Values.configMap.entity_ds_db_conf "postgres") }}
40 {{- if .Values.postgresql.jdbcImage.enabled }} 40 {{- if .Values.postgresql.jdbcImage.enabled }}
41 - name: postgresql-copy-jdbc 41 - name: postgresql-copy-jdbc
42 image: "{{ .Values.postgresql.jdbcImage.repository }}:{{ .Values.postgresql.jdbcImage.tag }}" 42 {{ include "moqui.image-helper" .Values.postgresql.jdbcImage | nindent 10 }}
43 imagePullPolicy: {{ .Values.postgresql.jdbcImage.pullPolicy }}
44 command: 43 command:
45 - bash 44 - bash
46 - -cx 45 - -cx
...@@ -52,8 +51,7 @@ spec: ...@@ -52,8 +51,7 @@ spec:
52 {{- end }} 51 {{- end }}
53 {{- if (.Values.checkDsConnection.enabled) }} 52 {{- if (.Values.checkDsConnection.enabled) }}
54 - name: postgresql-check-connection 53 - name: postgresql-check-connection
55 image: "{{ .Values.postgresql.image.registry }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}" 54 {{ include "moqui.image-helper" .Values.postgresql.image | nindent 10 }}
56 imagePullPolicy: {{ .Values.postgresql.image.pullPolicy }}
57 env: 55 env:
58 - name: POSTGRES_HOST 56 - name: POSTGRES_HOST
59 value: {{ include "moqui.entity_ds_host" . }} 57 value: {{ include "moqui.entity_ds_host" . }}
...@@ -75,8 +73,7 @@ spec: ...@@ -75,8 +73,7 @@ spec:
75 {{- define "moqui-container-pod" }} 73 {{- define "moqui-container-pod" }}
76 securityContext: 74 securityContext:
77 {{- toYaml .Values.securityContext | nindent 12 }} 75 {{- toYaml .Values.securityContext | nindent 12 }}
78 image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 76 {{ include "moqui.image-helper" .Values.image | nindent 10 }}
79 imagePullPolicy: {{ .Values.image.pullPolicy }}
80 command: ["java", "-server", "-XX:-OmitStackTraceInFastThrow", "-cp", ".", "MoquiStart"] 77 command: ["java", "-server", "-XX:-OmitStackTraceInFastThrow", "-cp", ".", "MoquiStart"]
81 envFrom: 78 envFrom:
82 - configMapRef: 79 - configMapRef:
......