diff --git a/helm/charts/keto/templates/job-migration.yaml b/helm/charts/keto/templates/job-migration.yaml index f50d5e3fb..6c88f42a4 100644 --- a/helm/charts/keto/templates/job-migration.yaml +++ b/helm/charts/keto/templates/job-migration.yaml @@ -1,4 +1,8 @@ {{- if .Values.keto.autoMigrate }} +{{- $extraLabels := ternary .Values.deployment.extraLabels .Values.extraLabels (not (empty .Values.deployment.extraLabels )) -}} +{{- $extraVolumeMounts := ternary .Values.deployment.extraVolumeMounts .Values.extraVolumeMounts (not (empty .Values.deployment.extraVolumeMounts )) -}} +{{- $extraEnv := ternary .Values.deployment.extraEnv .Values.extraEnv (not (empty .Values.deployment.extraEnv )) -}} +{{- $extraVolumes := ternary .Values.deployment.extraVolumes .Values.extraVolumes (not (empty .Values.deployment.extraVolumes )) -}} --- apiVersion: batch/v1 kind: Job @@ -9,16 +13,13 @@ metadata: {{- end }} labels: {{ include "keto.labels" . | indent 4 }} - {{- with .Values.extraLabels }} + {{- with $extraLabels }} {{- toYaml . | nindent 4 }} {{- end }} annotations: {{- with .Values.job.annotations }} {{- toYaml . | nindent 4 }} {{- end }} - helm.sh/hook-weight: "1" - helm.sh/hook: "pre-install, pre-upgrade" - helm.sh/hook-delete-policy: "before-hook-creation,hook-succeeded" spec: template: metadata: @@ -27,7 +28,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- with .Values.extraLabels }} + {{- with $extraLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -50,7 +51,7 @@ spec: - name: {{ include "keto.name" . }}-config-volume mountPath: /etc/config readOnly: true - {{- with .Values.extraVolumeMounts }} + {{- with $extraVolumeMounts }} {{- toYaml . | nindent 10 }} {{- end }} env: @@ -59,6 +60,9 @@ spec: secretKeyRef: name: {{ include "keto.secretname" . }} key: dsn + {{- with $extraEnv }} + {{- toYaml . | nindent 10 }} + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 10 }} {{- if .Values.job.extraContainers }} @@ -69,7 +73,7 @@ spec: - name: {{ include "keto.name" . }}-config-volume configMap: name: {{ include "keto.fullname" . }}-migrate - {{- with .Values.extraVolumes }} + {{- with $extraVolumes }} {{- toYaml . | nindent 8 }} {{- end }} shareProcessNamespace: {{ .Values.job.shareProcessNamespace }} diff --git a/helm/charts/keto/values.yaml b/helm/charts/keto/values.yaml index 92c5661a5..b20f54c6e 100644 --- a/helm/charts/keto/values.yaml +++ b/helm/charts/keto/values.yaml @@ -41,7 +41,10 @@ securityContext: job: # -- If you do want to specify annotations, uncomment the following # lines, adjust them as necessary, and remove the curly braces after 'annotations:'. - annotations: {} + annotations: + helm.sh/hook-weight: "1" + helm.sh/hook: "pre-install, pre-upgrade" + helm.sh/hook-delete-policy: "before-hook-creation,hook-succeeded" # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true"