Merge pull request #108032 from deejross/kep3140-cronjob-timezone

KEP 3140: TimeZone support for CronJob

Kubernetes-commit: 0f2300575c805bb70ba181957684361bcd25f86a
This commit is contained in:
Kubernetes Publisher 2022-03-29 17:34:20 -07:00
commit 9cfda74c80
5 changed files with 28 additions and 4 deletions

View File

@ -26,6 +26,7 @@ import (
// with apply.
type CronJobSpecApplyConfiguration struct {
Schedule *string `json:"schedule,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
ConcurrencyPolicy *v1.ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
Suspend *bool `json:"suspend,omitempty"`
@ -48,6 +49,14 @@ func (b *CronJobSpecApplyConfiguration) WithSchedule(value string) *CronJobSpecA
return b
}
// WithTimeZone sets the TimeZone field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TimeZone field is set to the value of the last call.
func (b *CronJobSpecApplyConfiguration) WithTimeZone(value string) *CronJobSpecApplyConfiguration {
b.TimeZone = &value
return b
}
// WithStartingDeadlineSeconds sets the StartingDeadlineSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the StartingDeadlineSeconds field is set to the value of the last call.

View File

@ -26,6 +26,7 @@ import (
// with apply.
type CronJobSpecApplyConfiguration struct {
Schedule *string `json:"schedule,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
ConcurrencyPolicy *v1beta1.ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
Suspend *bool `json:"suspend,omitempty"`
@ -48,6 +49,14 @@ func (b *CronJobSpecApplyConfiguration) WithSchedule(value string) *CronJobSpecA
return b
}
// WithTimeZone sets the TimeZone field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the TimeZone field is set to the value of the last call.
func (b *CronJobSpecApplyConfiguration) WithTimeZone(value string) *CronJobSpecApplyConfiguration {
b.TimeZone = &value
return b
}
// WithStartingDeadlineSeconds sets the StartingDeadlineSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the StartingDeadlineSeconds field is set to the value of the last call.

View File

@ -2956,6 +2956,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: suspend
type:
scalar: boolean
- name: timeZone
type:
scalar: string
- name: io.k8s.api.batch.v1.CronJobStatus
map:
fields:
@ -3157,6 +3160,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: suspend
type:
scalar: boolean
- name: timeZone
type:
scalar: string
- name: io.k8s.api.batch.v1beta1.CronJobStatus
map:
fields:

4
go.mod
View File

@ -34,7 +34,7 @@ require (
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
google.golang.org/protobuf v1.27.1
k8s.io/api v0.0.0-20220329211022-ed1c913933d7
k8s.io/api v0.0.0-20220330011018-e78ec1453ec9
k8s.io/apimachinery v0.0.0-20220329130813-31e52c987dc1
k8s.io/klog/v2 v2.60.1
k8s.io/kube-openapi v0.0.0-20220324211241-9f9c01d62a3a
@ -44,6 +44,6 @@ require (
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20220329211022-ed1c913933d7
k8s.io/api => k8s.io/api v0.0.0-20220330011018-e78ec1453ec9
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20220329130813-31e52c987dc1
)

4
go.sum
View File

@ -628,8 +628,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20220329211022-ed1c913933d7 h1:jkj8qyruAlbi+qRLYnpM9Cz/llMLfJYiykRF0Xqd0qs=
k8s.io/api v0.0.0-20220329211022-ed1c913933d7/go.mod h1:DtY4NYpJTdEZbyZNYT6OchYvejyTwdm7DK07dMzPcII=
k8s.io/api v0.0.0-20220330011018-e78ec1453ec9 h1:bDhkCqowj7oJQXnR4ZxXqWQlH5X+ropghHnAKlhOhnE=
k8s.io/api v0.0.0-20220330011018-e78ec1453ec9/go.mod h1:DtY4NYpJTdEZbyZNYT6OchYvejyTwdm7DK07dMzPcII=
k8s.io/apimachinery v0.0.0-20220329130813-31e52c987dc1 h1:ESix+UawmXFu9oem7ngnHSbufLCiIQrvn9TXHB1x/w4=
k8s.io/apimachinery v0.0.0-20220329130813-31e52c987dc1/go.mod h1:WkN7hnr/sIpKTK8v3BZKqLkdqTMz00TBdMWqE0M0O7Q=
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=