[COMMON] Make imagePullSecrets configurable
[oom.git] / kubernetes / so / components / so-mariadb / templates / job.yaml
index 7be44c4..d1fce49 100644 (file)
@@ -73,8 +73,7 @@ spec:
       - name: backup-storage
         persistentVolumeClaim:
           claimName: {{ include "common.fullname" . }}-migration
-      imagePullSecrets:
-        - name: "{{ include "common.namespace" . }}-docker-registry-key"
+      {{- include "common.imagePullSecrets" . | nindent 6 }}
       restartPolicy: Never
 ---
 {{- end }}
@@ -101,7 +100,20 @@ spec:
         release: {{ include "common.release" . }}
       name: {{ include "common.name" . }}
     spec:
-      initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
+      initContainers:
+      {{- if .Values.global.mariadbGalera.localCluster }}
+      {{-   if .Values.global.mariadbGalera.useOperator }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local_operator ) | indent 6 | trim }}
+      {{    else }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }}
+      {{-   end }}
+      {{ else }}
+      {{-   if .Values.global.mariadbGalera.useOperator }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global_operator ) | indent 6 | trim }}
+      {{   else }}
+      {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }}
+      {{-   end }}
+      {{- end }}
       containers:
       - name: {{ include "common.name" . }}-config
         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
@@ -193,5 +205,4 @@ spec:
           claimName: {{ include "common.fullname" . }}-migration
       {{- end }}
       restartPolicy: Never
-      imagePullSecrets:
-      - name: "{{ include "common.namespace" . }}-docker-registry-key"
+      {{- include "common.imagePullSecrets" . | nindent 6 }}