Skip to content

Commit

Permalink
Merge pull request #147 from gimlet-io/feat/pod-annotations-cron-job
Browse files Browse the repository at this point in the history
feat: ability to add pod annotations for cron-job template
  • Loading branch information
YoucefGuichi authored Oct 8, 2024
2 parents a45da57 + db7ee90 commit 24f03ea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions charts/cron-job/templates/cronJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ spec:
jobTemplate:
spec:
template:
metadata:
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 12 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
17 changes: 17 additions & 0 deletions charts/cron-job/tests/cronjob_pod_annotations_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
suite: test cron job
templates:
- cronJob.yaml
tests:
- it: Should set pod annotations
set:
podAnnotations:
annotation-one: no-such-annotation
annotation-two: no-such-annotation
asserts:
- template: cronJob.yaml
documentIndex: 0
equal:
path: spec.jobTemplate.spec.template.metadata.annotations
value:
annotation-one: no-such-annotation
annotation-two: no-such-annotation

0 comments on commit 24f03ea

Please sign in to comment.