Skip to content

Commit

Permalink
charts/cron-job: Add ability to specify multiple files per config-map (
Browse files Browse the repository at this point in the history
…closes #48)
  • Loading branch information
jbeemster committed Aug 26, 2022
1 parent 8fc3cd4 commit 21a3c83
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/cron-job/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: cron-job
description: A Helm Chart to deploy an arbitrary container as a cron job.
version: 0.4.3
version: 0.5.0
icon: https://raw.githubusercontent.com/snowplow-devops/helm-charts/master/docs/logo/snowplow.png
home: https://github.com/snowplow-devops/helm-charts
sources:
Expand Down
8 changes: 7 additions & 1 deletion charts/cron-job/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ kind: ConfigMap
metadata:
name: {{ $v.name }}
binaryData:
{{ $v.key }}: "{{ $v.contentsB64 }}"
{{- range $f := $v.files }}
{{- if $f.contentsB64 }}
{{ $f.key }}: "{{ $f.contentsB64 }}"
{{- else }}
{{ $f.key }}: "{{ ($.Files.Get $f.contentsFile) | b64enc }}"
{{- end }}
{{- end }}
---
{{- end }}
{{- end }}
8 changes: 7 additions & 1 deletion charts/cron-job/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ spec:
annotations:
{{- if .Values.configMaps }}
{{- range $v := .Values.configMaps }}
checksum/{{ $v.name }}-{{ $v.key }}: "{{ $v.contentsB64 | sha256sum }}"
{{- range $f := $v.files }}
{{- if $f.contentsB64 }}
checksum/{{ $v.name }}-{{ $f.key }}: "{{ $f.contentsB64 | sha256sum }}"
{{- else }}
checksum/{{ $v.name }}-{{ $f.key }}: "{{ ($.Files.Get $f.contentsFile) | b64enc | sha256sum }}"
{{- end }}
{{- end }}
{{- end }}
{{- end }}
spec:
Expand Down
6 changes: 4 additions & 2 deletions charts/cron-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ config:
# -- List of config maps to mount to the deployment
configMaps: []
# - name: "volume-1"
# key: "file.cfg"
# contentsB64: "" # The file contents which have already been base-64 encoded
# mountPath: "/etc/config" # Must be unique
# mountPropagation: None # If unset will default to 'None'
# files: []
# - key: "file.cfg" # Key must be unique for each file
# contentsB64: "" # The file contents which have already been base-64 encoded
# contentsFile: "" # The path to a local file (note: contentsB64 will take precedence if not-empty)

dockerconfigjson:
# -- Name of the secret to use for the private repository
Expand Down

0 comments on commit 21a3c83

Please sign in to comment.