Skip to content

Commit 19a7625

Browse files
authored
chore: fix custom migration job (#734)
1 parent c8245ac commit 19a7625

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

helm/charts/hydra/templates/job-migrations-custom.yaml

+36-36
Original file line numberDiff line numberDiff line change
@@ -43,56 +43,56 @@ spec:
4343
{{- toYaml . | nindent 8 }}
4444
{{- end }}
4545
spec:
46-
{{- with $.Values.imagePullSecrets }}
46+
{{- with $.Values.imagePullSecrets }}
4747
imagePullSecrets:
4848
{{- toYaml . | nindent 8 }}
49-
{{- end }}
49+
{{- end }}
5050
serviceAccountName: {{ include "hydra.job.serviceAccountName" $ }}
5151
automountServiceAccountToken: {{ $.Values.job.automountServiceAccountToken }}
5252
containers:
53-
- name: {{ $.Chart.Name }}-{{ $jobName }}
54-
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
55-
imagePullPolicy: {{ $.Values.image.pullPolicy }}
56-
{{- if $job.customCommand }}
57-
command: {{- toYaml $job.customCommand | nindent 10 }}
58-
{{- else }}
59-
command: ["hydra"]
60-
{{- end }}
61-
args: {{- toYaml $job.customArgs | nindent 10 }}
62-
env:
63-
{{- if not (empty ( include "hydra.dsn" $ )) }}
64-
{{- if not (include "ory.extraEnvContainsEnvName" (list $migrationExtraEnv "DSN")) }}
65-
- name: DSN
66-
valueFrom:
67-
secretKeyRef:
68-
name: {{ include "hydra.secretname" $ }}
69-
key: dsn
70-
{{- end }}
71-
{{- end }}
72-
{{- with $migrationExtraEnv }}
73-
{{- toYaml . | nindent 10 }}
53+
- name: {{ $.Chart.Name }}-{{ $jobName }}
54+
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
55+
imagePullPolicy: {{ $.Values.image.pullPolicy }}
56+
{{- if $job.customCommand }}
57+
command: {{- toYaml $job.customCommand | nindent 10 }}
58+
{{- else }}
59+
command: ["hydra"]
60+
{{- end }}
61+
args: {{- toYaml $job.customArgs | nindent 10 }}
62+
env:
63+
{{- if not (empty ( include "hydra.dsn" $ )) }}
64+
{{- if not (include "ory.extraEnvContainsEnvName" (list $migrationExtraEnv "DSN")) }}
65+
- name: DSN
66+
valueFrom:
67+
secretKeyRef:
68+
name: {{ include "hydra.secretname" $ }}
69+
key: dsn
7470
{{- end }}
75-
lifecycle:
71+
{{- end }}
72+
{{- with $migrationExtraEnv }}
73+
{{- toYaml . | nindent 10 }}
74+
{{- end }}
75+
lifecycle:
7676
{{- if $.Values.job.lifecycle }}
7777
{{- tpl $.Values.job.lifecycle $ | nindent 10 }}
7878
{{- end }}
7979
{{- with $.Values.deployment.securityContext }}
80-
securityContext:
80+
securityContext:
8181
{{- toYaml . | nindent 10 }}
8282
{{- end }}
8383
{{- with $resources }}
84-
resources:
84+
resources:
8585
{{- toYaml . | nindent 10 }}
8686
{{- end }}
87-
volumeMounts:
88-
- name: {{ include "hydra.name" $ }}-config-volume
89-
mountPath: /etc/config
90-
readOnly: true
91-
{{- if $job.extraVolumeMounts }}
92-
{{- toYaml $job.extraVolumeMounts | nindent 12 }}
93-
{{- else if $.Values.deployment.extraVolumeMounts }}
94-
{{- toYaml $.Values.deployment.extraVolumeMounts | nindent 12 }}
95-
{{- end }}
87+
volumeMounts:
88+
- name: {{ include "hydra.name" $ }}-config-volume
89+
mountPath: /etc/config
90+
readOnly: true
91+
{{- if $job.extraVolumeMounts }}
92+
{{- toYaml $job.extraVolumeMounts | nindent 12 }}
93+
{{- else if $.Values.deployment.extraVolumeMounts }}
94+
{{- toYaml $.Values.deployment.extraVolumeMounts | nindent 12 }}
95+
{{- end }}
9696
{{- if $.Values.job.extraContainers }}
9797
{{- tpl $.Values.job.extraContainers $ | nindent 6 }}
9898
{{- end }}
@@ -125,4 +125,4 @@ spec:
125125
{{- end }}
126126
backoffLimit: {{ $.Values.job.spec.backoffLimit }}
127127
{{- end }}
128-
{{- end }}
128+
{{- end }}

0 commit comments

Comments
 (0)