diff --git a/charts/cronjobs/Chart.yaml b/charts/cronjobs/Chart.yaml index 4cb6f6e..b7543f1 100644 --- a/charts/cronjobs/Chart.yaml +++ b/charts/cronjobs/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: cronjobs description: A generic helm cronjob chart for kubernetes type: application -version: 1.1.0 +version: 1.1.1 appVersion: latest home: https://github.com/klicktipp/helm-charts keywords: diff --git a/charts/cronjobs/templates/configmap.yaml b/charts/cronjobs/templates/configmap.yaml index 3cadde2..3954f49 100644 --- a/charts/cronjobs/templates/configmap.yaml +++ b/charts/cronjobs/templates/configmap.yaml @@ -27,7 +27,7 @@ data: {{- end }} {{- range $job_name, $job := .Values.jobs }} -{{- if and (hasKey $job "extraFiles") $job.extraFiles }} +{{- if and $job (hasKey $job "extraFiles") $job.extraFiles }} {{- $checksum := toYaml $job.extraFiles | sha256sum | trunc 20 | quote }} --- apiVersion: v1 diff --git a/charts/cronjobs/templates/cronjob.yaml b/charts/cronjobs/templates/cronjob.yaml index 7accd32..7c52290 100644 --- a/charts/cronjobs/templates/cronjob.yaml +++ b/charts/cronjobs/templates/cronjob.yaml @@ -2,6 +2,7 @@ {{- $chart_name := include "cronjobs.fullname" . }} {{- $service_account_name := include "cronjobs.serviceAccountName" . }} {{- range $job_name, $job := .Values.jobs }} +{{- if $job }} {{- $JOB_NAME_SLUG := include "com.klicktipp.slugify-volume-name" $job_name }} {{- $env := mergeOverwrite dict $.Values.env ($job.env | default dict) }} --- @@ -179,4 +180,5 @@ spec: secret: secretName: {{ print $chart_name "-" $job_name }} {{- end }} - {{- end }} +{{- end }} {{/* # end if check $job */}} +{{- end }} {{/* # end range $job */}} diff --git a/charts/cronjobs/templates/volumes.yaml b/charts/cronjobs/templates/volumes.yaml index 72c5b1c..9455766 100644 --- a/charts/cronjobs/templates/volumes.yaml +++ b/charts/cronjobs/templates/volumes.yaml @@ -1,7 +1,7 @@ --- {{- range $job_name, $job := .Values.jobs }} {{- $JOB_NAME_SLUG := include "com.klicktipp.slugify-volume-name" $job_name }} -{{- if and $job.storage (hasKey $job.storage "efs") (hasKey $job.storage.efs "mounts") }} +{{- if and $job (hasKey $job "storage") (hasKey $job.storage "efs") (hasKey $job.storage.efs "mounts") }} {{- range $efs_mount := $job.storage.efs.mounts }} {{- range $efs_ap := $efs_mount.access_points }} {{- $EFS_AP_ID_TRIMMED := trimPrefix "fsap-" $efs_ap.id }}