Skip to content

Commit 82eb73a

Browse files
committed
Address comments
1 parent b64b3bf commit 82eb73a

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

keps/sig-apps/3140-TimeZone-support-in-CronJob/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
6363
## Summary
6464

6565
CronJob creates Jobs based on the schedule specified by the author, but the Time
66-
Zone used during the creation depens on where kube-controller-manager is running.
66+
Zone used during the creation depends on where kube-controller-manager is running.
6767
This proposal aims to extend CronJob resource with the ability for a user to
6868
define the TimeZone when a Job should be created.
6969

@@ -76,13 +76,13 @@ at the time was that introducing such functionality would require cluster operat
7676
to manually include TimeZone database since golang did not have one.
7777
Starting from [golang 1.15](https://go.dev/doc/go1.15) `time/tzdata` package can
7878
be embedded in the binary thus removing the requirement for external database.
79-
At that time the majority of the focus was towards [moving CronJob to GA](https://github.com/kubernetes/enhancements/issues/19)
79+
At that time, the majority of the focus was towards [moving CronJob to GA](https://github.com/kubernetes/enhancements/issues/19),
8080
so the effort to support TimeZone was again delayed. Now that we have CronJob
8181
fully GA-ed it's time to satisfy the original request.
8282

8383
### Goals
8484

85-
- Add the field `.spec.timeZone` which allows specifying a valid TimeZone
85+
- Add the field `.spec.timeZone` which allows specifying a valid TimeZone name
8686

8787
### Non-Goals
8888

@@ -95,14 +95,14 @@ and make progress.
9595

9696
Add the field `.spec.timeZone` to the CronJob resource. The cronjob controller
9797
will take the field into account when scheduling the next Job run. In case the
98-
field is not specified or is empty the controller will maitain the current
99-
behavior which is to rely on the time zone of the kube-controller-manager
98+
field is not specified or is empty, the controller will maintain the current
99+
behavior, which is to rely on the time zone of the kube-controller-manager
100100
process.
101101

102102
### Notes/Constraints/Caveats (Optional)
103103

104-
The current mechanism, which will still be the default behavior heavily relies
105-
on the time zone of the kube-controller-manager process which is hard for a
104+
The current mechanism, which will still be the default behavior, heavily relies
105+
on the time zone of the kube-controller-manager process, which is hard for a
106106
regular user to figure out. Exposing an explicit field for setting a time zone
107107
will allow CronJob authors to simplify the user experience when creating CronJobs.
108108

@@ -125,20 +125,22 @@ CronJobs can be created per user.
125125

126126
### CronJob API
127127

128-
The `CronJobSpec` structure is expanded with new `TimeZone` field which allows
128+
The `.spec` for a CronJob is expanded with a new `timeZone` field which allows
129129
specifying the name of the time zone to be used. Missing or empty value of the
130130
field indicates the current behavior, which relies on the time zone of the
131131
kube-controller-manager process.
132132

133+
In the API code, that looks like:
134+
133135
```golang
134136

135137
type CronJobSpec struct {
136138

137-
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
138-
Schedule string
139+
// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
140+
Schedule string
139141

140-
// Time zone for the above schedule
141-
TimeZone *string
142+
// Time zone for the above schedule
143+
TimeZone *string
142144

143145
}
144146
```
@@ -149,7 +151,7 @@ golang timezone database.
149151
### CronJob controller
150152

151153
CronJob controller will use non-nil, non-empty value from `TimeZone` field when
152-
parsing the schedule and during scheduling the next run time. Additionally the
154+
parsing the schedule and during scheduling the next run time. Additionally, the
153155
time zone will be reflected in the `.status.lastSuccessfulTime` and `.status.lastScheduleTime`.
154156
In all other cases the controller will maintain the current behavior.
155157

@@ -489,6 +491,9 @@ Why should this KEP _not_ be implemented?
489491

490492
## Alternatives
491493

494+
Another approach was to specify time zone as an offset to UTC, but using the
495+
name instead seems more user friendly.
496+
492497
<!--
493498
What other approaches did you consider, and why did you rule them out? These do
494499
not need to be as detailed as the proposal, but should include enough

keps/sig-apps/3140-TimeZone-support-in-CronJob/kep.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ status: implementable
88
creation-date: 2022-01-14
99
reviewers:
1010
- "@ravig"
11+
- "@atiratree"
1112
- "@iterion"
1213
approvers:
1314
- "@janetkuo"
@@ -41,4 +42,4 @@ disable-supported: true
4142

4243
# The following PRR answers are required at beta release
4344
metrics:
44-
- my_feature_metric
45+
# - my_feature_metric

0 commit comments

Comments
 (0)