diff --git a/charts/cron-job/charts/common-0.1.0.tgz b/charts/cron-job/charts/common-0.1.0.tgz index c0eadee..7eb888e 100644 Binary files a/charts/cron-job/charts/common-0.1.0.tgz and b/charts/cron-job/charts/common-0.1.0.tgz differ diff --git a/charts/cron-job/templates/cronJob.yaml b/charts/cron-job/templates/cronJob.yaml index ddf5db3..d999ed8 100644 --- a/charts/cron-job/templates/cronJob.yaml +++ b/charts/cron-job/templates/cronJob.yaml @@ -7,10 +7,9 @@ metadata: {{- include "helm-chart.labels" . | nindent 4 }} spec: schedule: {{ .Values.schedule | quote }} - successfulJobsHistoryLimit: 1 - failedJobsHistoryLimit: 1 - concurrencyPolicy: Forbid - startingDeadlineSeconds: 120 + {{ with .Values.constraints }} + {{ toYaml . | nindent 2 }} + {{- end }} jobTemplate: spec: template: diff --git a/charts/cron-job/tests/cronjob_costraints_test.yaml b/charts/cron-job/tests/cronjob_costraints_test.yaml new file mode 100644 index 0000000..f430172 --- /dev/null +++ b/charts/cron-job/tests/cronjob_costraints_test.yaml @@ -0,0 +1,17 @@ +suite: test cron job +templates: + - cronJob.yaml +tests: + - it: Should have default constraints + asserts: + - equal: + path: spec.successfulJobsHistoryLimit + value: 1 + - it: Should constraints be configurable + set: + constraints: + successfulJobsHistoryLimit: 2 + asserts: + - equal: + path: spec.successfulJobsHistoryLimit + value: 2 diff --git a/charts/cron-job/values.yaml b/charts/cron-job/values.yaml index 462dcc5..f0bca92 100644 --- a/charts/cron-job/values.yaml +++ b/charts/cron-job/values.yaml @@ -27,3 +27,9 @@ affinity: {} secret: enabled: false + +constraints: + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 + concurrencyPolicy: Forbid + startingDeadlineSeconds: 120 diff --git a/charts/onechart/charts/common-0.1.0.tgz b/charts/onechart/charts/common-0.1.0.tgz index 2b9cdb8..2f255ff 100644 Binary files a/charts/onechart/charts/common-0.1.0.tgz and b/charts/onechart/charts/common-0.1.0.tgz differ