Skip to content

Commit

Permalink
Add metadata to cronjob template
Browse files Browse the repository at this point in the history
Signed-off-by: Joey Akitoye <[email protected]>
  • Loading branch information
samtoya committed Oct 7, 2024
1 parent 5e7f38e commit 38df483
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lint:
helm lint flow

template:
helm template flow-helm-chart flow --debug --values flow/values.yaml
helm template flow-helm-chart flow --values flow/values.yaml

bundle:
make lint
Expand Down
6 changes: 6 additions & 0 deletions flow/templates/cronjob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ spec:
backoffLimit: {{ .Values.cronJob.backoffLimit | default 5 }}
backoffLimitPerIndex: {{ .Values.cronJob.backoffLimitPerIndex }}
template:
{{ if and .Values.cronJob.metadata (not (empty .Values.cronJob.metadata)) }}
metadata:
{{ range $k, $v := .Values.cronJob.metadata }}
{{ $k }}: {{ $v }}
{{- end }}
{{- end }}
spec:
{{ if and .Values.cronJob.containers (not (empty .Values.cronJob.containers ) ) }}
containers:
Expand Down
1 change: 1 addition & 0 deletions flow/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ cronJob:
namespace: default
schedule: "59 23 28-31 * *"
containers: { }
metadata: { }

persistentVolume:
enabled: false
Expand Down

0 comments on commit 38df483

Please sign in to comment.