Commit ca3c4b39 authored by peay's avatar peay

Re-generate code and API spec for CronJob API

parent 2b33de06
......@@ -40977,6 +40977,11 @@
"description": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.",
"type": "string"
},
"failedJobsHistoryLimit": {
"description": "The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
"type": "integer",
"format": "int32"
},
"jobTemplate": {
"description": "JobTemplate is the object that describes the job that will be created when executing a CronJob.",
"$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.batch.v2alpha1.JobTemplateSpec"
......@@ -40990,6 +40995,11 @@
"type": "integer",
"format": "int64"
},
"successfulJobsHistoryLimit": {
"description": "The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
"type": "integer",
"format": "int32"
},
"suspend": {
"description": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.",
"type": "boolean"
......@@ -82,6 +82,16 @@ message CronJobSpec {
// JobTemplate is the object that describes the job that will be created when
// executing a CronJob.
optional JobTemplateSpec jobTemplate = 5;
// The number of successful finished jobs to retain.
// This is a pointer to distinguish between explicit zero and not specified.
// +optional
optional int32 successfulJobsHistoryLimit = 6;
// The number of failed finished jobs to retain.
// This is a pointer to distinguish between explicit zero and not specified.
// +optional
optional int32 failedJobsHistoryLimit = 7;
}
// CronJobStatus represents the current state of a cron job.
......
......@@ -3793,15 +3793,17 @@ func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} else {
yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [5]bool
var yyq2 [7]bool
_, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false
yyq2[1] = x.StartingDeadlineSeconds != nil
yyq2[2] = x.ConcurrencyPolicy != ""
yyq2[3] = x.Suspend != nil
yyq2[5] = x.SuccessfulJobsHistoryLimit != nil
yyq2[6] = x.FailedJobsHistoryLimit != nil
var yynn2 int
if yyr2 || yy2arr2 {
r.EncodeArrayStart(5)
r.EncodeArrayStart(7)
} else {
yynn2 = 2
for _, b := range yyq2 {
......@@ -3928,6 +3930,76 @@ func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
yy22.CodecEncodeSelf(e)
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[5] {
if x.SuccessfulJobsHistoryLimit == nil {
r.EncodeNil()
} else {
yy25 := *x.SuccessfulJobsHistoryLimit
yym26 := z.EncBinary()
_ = yym26
if false {
} else {
r.EncodeInt(int64(yy25))
}
}
} else {
r.EncodeNil()
}
} else {
if yyq2[5] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("successfulJobsHistoryLimit"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.SuccessfulJobsHistoryLimit == nil {
r.EncodeNil()
} else {
yy27 := *x.SuccessfulJobsHistoryLimit
yym28 := z.EncBinary()
_ = yym28
if false {
} else {
r.EncodeInt(int64(yy27))
}
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[6] {
if x.FailedJobsHistoryLimit == nil {
r.EncodeNil()
} else {
yy30 := *x.FailedJobsHistoryLimit
yym31 := z.EncBinary()
_ = yym31
if false {
} else {
r.EncodeInt(int64(yy30))
}
}
} else {
r.EncodeNil()
}
} else {
if yyq2[6] {
z.EncSendContainerState(codecSelfer_containerMapKey1234)
r.EncodeString(codecSelferC_UTF81234, string("failedJobsHistoryLimit"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
if x.FailedJobsHistoryLimit == nil {
r.EncodeNil()
} else {
yy32 := *x.FailedJobsHistoryLimit
yym33 := z.EncBinary()
_ = yym33
if false {
} else {
r.EncodeInt(int64(yy32))
}
}
}
}
if yyr2 || yy2arr2 {
z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234)
......@@ -4046,6 +4118,38 @@ func (x *CronJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
yyv11 := &x.JobTemplate
yyv11.CodecDecodeSelf(d)
}
case "successfulJobsHistoryLimit":
if r.TryDecodeAsNil() {
if x.SuccessfulJobsHistoryLimit != nil {
x.SuccessfulJobsHistoryLimit = nil
}
} else {
if x.SuccessfulJobsHistoryLimit == nil {
x.SuccessfulJobsHistoryLimit = new(int32)
}
yym13 := z.DecBinary()
_ = yym13
if false {
} else {
*((*int32)(x.SuccessfulJobsHistoryLimit)) = int32(r.DecodeInt(32))
}
}
case "failedJobsHistoryLimit":
if r.TryDecodeAsNil() {
if x.FailedJobsHistoryLimit != nil {
x.FailedJobsHistoryLimit = nil
}
} else {
if x.FailedJobsHistoryLimit == nil {
x.FailedJobsHistoryLimit = new(int32)
}
yym15 := z.DecBinary()
_ = yym15
if false {
} else {
*((*int32)(x.FailedJobsHistoryLimit)) = int32(r.DecodeInt(32))
}
}
default:
z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3
......@@ -4057,16 +4161,16 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj12 int
var yyb12 bool
var yyhl12 bool = l >= 0
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
var yyj16 int
var yyb16 bool
var yyhl16 bool = l >= 0
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb12 = r.CheckBreak()
yyb16 = r.CheckBreak()
}
if yyb12 {
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
......@@ -4074,21 +4178,21 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Schedule = ""
} else {
yyv13 := &x.Schedule
yym14 := z.DecBinary()
_ = yym14
yyv17 := &x.Schedule
yym18 := z.DecBinary()
_ = yym18
if false {
} else {
*((*string)(yyv13)) = r.DecodeString()
*((*string)(yyv17)) = r.DecodeString()
}
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb12 = r.CheckBreak()
yyb16 = r.CheckBreak()
}
if yyb12 {
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
......@@ -4101,20 +4205,20 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.StartingDeadlineSeconds == nil {
x.StartingDeadlineSeconds = new(int64)
}
yym16 := z.DecBinary()
_ = yym16
yym20 := z.DecBinary()
_ = yym20
if false {
} else {
*((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64))
}
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb12 = r.CheckBreak()
yyb16 = r.CheckBreak()
}
if yyb12 {
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
......@@ -4122,16 +4226,16 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.ConcurrencyPolicy = ""
} else {
yyv17 := &x.ConcurrencyPolicy
yyv17.CodecDecodeSelf(d)
yyv21 := &x.ConcurrencyPolicy
yyv21.CodecDecodeSelf(d)
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb12 = r.CheckBreak()
yyb16 = r.CheckBreak()
}
if yyb12 {
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
......@@ -4144,20 +4248,20 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Suspend == nil {
x.Suspend = new(bool)
}
yym19 := z.DecBinary()
_ = yym19
yym23 := z.DecBinary()
_ = yym23
if false {
} else {
*((*bool)(x.Suspend)) = r.DecodeBool()
}
}
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb12 = r.CheckBreak()
yyb16 = r.CheckBreak()
}
if yyb12 {
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
......@@ -4165,21 +4269,73 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.JobTemplate = JobTemplateSpec{}
} else {
yyv20 := &x.JobTemplate
yyv20.CodecDecodeSelf(d)
yyv24 := &x.JobTemplate
yyv24.CodecDecodeSelf(d)
}
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb16 = r.CheckBreak()
}
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
if x.SuccessfulJobsHistoryLimit != nil {
x.SuccessfulJobsHistoryLimit = nil
}
} else {
if x.SuccessfulJobsHistoryLimit == nil {
x.SuccessfulJobsHistoryLimit = new(int32)
}
yym26 := z.DecBinary()
_ = yym26
if false {
} else {
*((*int32)(x.SuccessfulJobsHistoryLimit)) = int32(r.DecodeInt(32))
}
}
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb16 = r.CheckBreak()
}
if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
if x.FailedJobsHistoryLimit != nil {
x.FailedJobsHistoryLimit = nil
}
} else {
if x.FailedJobsHistoryLimit == nil {
x.FailedJobsHistoryLimit = new(int32)
}
yym28 := z.DecBinary()
_ = yym28
if false {
} else {
*((*int32)(x.FailedJobsHistoryLimit)) = int32(r.DecodeInt(32))
}
}
for {
yyj12++
if yyhl12 {
yyb12 = yyj12 > l
yyj16++
if yyhl16 {
yyb16 = yyj16 > l
} else {
yyb12 = r.CheckBreak()
yyb16 = r.CheckBreak()
}
if yyb12 {
if yyb16 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj12-1, "")
z.DecStructFieldNotFound(yyj16-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}
......@@ -4772,7 +4928,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0
yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 1128)
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 1144)
if yyrt1 {
if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1]
......
......@@ -49,12 +49,14 @@ func (CronJobList) SwaggerDoc() map[string]string {
}
var map_CronJobSpec = map[string]string{
"": "CronJobSpec describes how the job execution will look like and when it will actually run.",
"schedule": "Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.",
"startingDeadlineSeconds": "Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.",
"concurrencyPolicy": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.",
"suspend": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.",
"jobTemplate": "JobTemplate is the object that describes the job that will be created when executing a CronJob.",
"": "CronJobSpec describes how the job execution will look like and when it will actually run.",
"schedule": "Schedule contains the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.",
"startingDeadlineSeconds": "Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions will be counted as failed ones.",
"concurrencyPolicy": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.",
"suspend": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.",
"jobTemplate": "JobTemplate is the object that describes the job that will be created when executing a CronJob.",
"successfulJobsHistoryLimit": "The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
"failedJobsHistoryLimit": "The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
}
func (CronJobSpec) SwaggerDoc() map[string]string {
......
......@@ -141,6 +141,8 @@ func autoConvert_v2alpha1_CronJobSpec_To_batch_CronJobSpec(in *CronJobSpec, out
if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil {
return err
}
out.SuccessfulJobsHistoryLimit = (*int32)(unsafe.Pointer(in.SuccessfulJobsHistoryLimit))
out.FailedJobsHistoryLimit = (*int32)(unsafe.Pointer(in.FailedJobsHistoryLimit))
return nil
}
......@@ -156,6 +158,8 @@ func autoConvert_batch_CronJobSpec_To_v2alpha1_CronJobSpec(in *batch.CronJobSpec
if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil {
return err
}
out.SuccessfulJobsHistoryLimit = (*int32)(unsafe.Pointer(in.SuccessfulJobsHistoryLimit))
out.FailedJobsHistoryLimit = (*int32)(unsafe.Pointer(in.FailedJobsHistoryLimit))
return nil
}
......
......@@ -106,6 +106,16 @@ func DeepCopy_v2alpha1_CronJobSpec(in interface{}, out interface{}, c *conversio
if err := DeepCopy_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil {
return err
}
if in.SuccessfulJobsHistoryLimit != nil {
in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit
*out = new(int32)
**out = **in
}
if in.FailedJobsHistoryLimit != nil {
in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit
*out = new(int32)
**out = **in
}
return nil
}
}
......
......@@ -106,6 +106,16 @@ func DeepCopy_batch_CronJobSpec(in interface{}, out interface{}, c *conversion.C
if err := DeepCopy_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil {
return err
}
if in.SuccessfulJobsHistoryLimit != nil {
in, out := &in.SuccessfulJobsHistoryLimit, &out.SuccessfulJobsHistoryLimit
*out = new(int32)
**out = **in
}
if in.FailedJobsHistoryLimit != nil {
in, out := &in.FailedJobsHistoryLimit, &out.FailedJobsHistoryLimit
*out = new(int32)
**out = **in
}
return nil
}
}
......
......@@ -16189,6 +16189,20 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
Ref: ref("k8s.io/kubernetes/pkg/apis/batch/v2alpha1.JobTemplateSpec"),
},
},
"successfulJobsHistoryLimit": {
SchemaProps: spec.SchemaProps{
Description: "The number of successful finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
Type: []string{"integer"},
Format: "int32",
},
},
"failedJobsHistoryLimit": {
SchemaProps: spec.SchemaProps{
Description: "The number of failed finished jobs to retain. This is a pointer to distinguish between explicit zero and not specified.",
Type: []string{"integer"},
Format: "int32",
},
},
},
Required: []string{"schedule", "jobTemplate"},
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment