Skip to content

Commit 65bb5e3

Browse files
committed
feat(cronjob): Add timeZone support
1 parent daecb74 commit 65bb5e3

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

toggle/django-app/templates/cronjobs/deployment.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ metadata:
1717
release: {{ $.Release.Name }}
1818
spec:
1919
schedule: {{ $job.schedule | quote }}
20+
{{- if $job.timeZone }}
21+
timeZone: {{ $job.timeZone | quote }}
22+
{{- end }}
2023
concurrencyPolicy: "Forbid"
2124
jobTemplate:
2225
spec:

toggle/django-app/values-test.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,24 @@ cronjobs:
9292
memory: 2Gi
9393
# NOTE: Application level configuration
9494
jobs:
95-
"dummy":
95+
dummy-01:
9696
enabled: true
9797
schedule: "0 0 * * *"
98-
command: ["./manage.py", "run-dummy-command"]
98+
command: ["./manage.py", "run-dummy-command", "01"]
9999
resources:
100100
requests:
101101
cpu: "2"
102102
memory: 4Gi
103+
dummy-02:
104+
enabled: true
105+
schedule: "0 0 * * *"
106+
timeZone: "Asia/Kathmandu"
107+
command: ["./manage.py", "run-dummy-command", "02"]
108+
dummy-03:
109+
enabled: false
110+
schedule: "* * * * *"
111+
timeZone: "Asia/Kathmandu"
112+
command: ["./manage.py", "run-dummy-command", "03"]
103113

104114
extraConfigMapName: "my-custom-envs"
105115
env:

toggle/django-app/values.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ cronjobs:
195195
cpu: "1"
196196
memory: 2Gi
197197
# NOTE: Application level configuration
198-
jobs:
199-
"dummy":
200-
schedule: "0 0 * * *"
201-
enabled: false
202-
command: ["./manage.py", "run-dummy-command"]
198+
jobs: {}
199+
# "dummy":
200+
# schedule: "0 0 * * *"
201+
# timeZone: "Asia/Kathmandu"
202+
# enabled: false
203+
# command: ["./manage.py", "run-dummy-command"]
203204

204205
# Not required if global image are set
205206
argoHook:

0 commit comments

Comments
 (0)