Job constraints configurable

This commit is contained in:
Laszlo Fogas
2021-08-05 10:56:29 +02:00
parent 4942164b9a
commit d91040c0a0
5 changed files with 26 additions and 4 deletions
Binary file not shown.
+3 -4
View File
@@ -7,10 +7,9 @@ metadata:
{{- include "helm-chart.labels" . | nindent 4 }} {{- include "helm-chart.labels" . | nindent 4 }}
spec: spec:
schedule: {{ .Values.schedule | quote }} schedule: {{ .Values.schedule | quote }}
successfulJobsHistoryLimit: 1 {{ with .Values.constraints }}
failedJobsHistoryLimit: 1 {{ toYaml . | nindent 2 }}
concurrencyPolicy: Forbid {{- end }}
startingDeadlineSeconds: 120
jobTemplate: jobTemplate:
spec: spec:
template: template:
@@ -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
+6
View File
@@ -27,3 +27,9 @@ affinity: {}
secret: secret:
enabled: false enabled: false
constraints:
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
concurrencyPolicy: Forbid
startingDeadlineSeconds: 120
Binary file not shown.