diff --git a/charts/offlineimap/Chart.yaml b/charts/offlineimap/Chart.yaml index c765b63..b37e6e2 100644 --- a/charts/offlineimap/Chart.yaml +++ b/charts/offlineimap/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 description: Helm chart for offlineimap name: offlineimap type: application -version: 0.0.9 +version: 0.0.11 kubeVersion: ">=1.16.0-0" keywords: - offlineimap diff --git a/charts/offlineimap/templates/cronjob.yaml b/charts/offlineimap/templates/cronjob.yaml index 64d5451..ef37f8f 100644 --- a/charts/offlineimap/templates/cronjob.yaml +++ b/charts/offlineimap/templates/cronjob.yaml @@ -27,4 +27,30 @@ spec: containers: - name: {{ include "common.names.fullname" . }} image: {{ printf "%s:%s" .Values.image.repository (default .Chart.AppVersion .Values.image.tag) | quote }} - imagePullPolicy: {{ .Values.image.pullPolicy }} \ No newline at end of file + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.env }} + env: + {{- range $k, $v := . }} + {{- $name := $k }} + {{- $value := $v }} + {{- if kindIs "int" $name }} + {{- $name = required "environment variables as a list of maps require a name field" $value.name }} + {{- end }} + - name: {{ quote $name }} + {{- if kindIs "map" $value -}} + {{- if hasKey $value "value" }} + {{- $value = $value.value -}} + {{- else if hasKey $value "valueFrom" }} + {{- toYaml $value | nindent 6 }} + {{- else }} + {{- dict "valueFrom" $value | toYaml | nindent 6 }} + {{- end }} + {{- end }} + {{- if not (kindIs "map" $value) }} + {{- if kindIs "string" $value }} + {{- $value = tpl $value $ }} + {{- end }} + value: {{ quote $value }} + {{- end }} + {{- end }} + {{- end }} \ No newline at end of file