Просмотр исходного кода

Add method to convert cron object to cron expression

Waqar Ahmed 4 лет назад
Родитель
Сommit
7aa966cbdb

+ 8 - 0
charts/ix-chart/2009.0.1/templates/_helpers.tpl

@@ -61,3 +61,11 @@ Create the name of the service account to use
 {{- default "default" .Values.serviceAccount.name }}
 {{- end }}
 {{- end }}
+
+
+{{/*
+Convert cron schema object to cron format
+*/}}
+{{- define "cronExpression" }}
+{{- printf "%s %s %s %s %s " .minute .hour .dom .month .dow }}
+{{- end }}

+ 1 - 1
charts/ix-chart/2009.0.1/templates/_workload.tpl

@@ -127,7 +127,7 @@ template:
 CronJob Spec
 */}}
 {{- define "cronJobSpec" }}
-schedule: {{ .Values.cronSchedule | quote }}
+schedule: {{ include "cronExpression" .Values.cronSchedule | quote }}
 jobTemplate:
   spec:
     {{ include "jobSpec" . | nindent 4 }}

+ 1 - 1
charts/ix-chart/2009.0.1/templates/workload.yaml

@@ -9,6 +9,6 @@ spec:
     {{ include "deploymentSpec" . | nindent 2 }}
   {{- else if eq (include "workloadIsCronJob" .) "true" }}
     {{ include "cronJobSpec" . | nindent 2 }}
-  {{- else }}}
+  {{- else }}
     {{ include "jobSpec" . | nindent 2 }}
   {{- end }}