Commit ca3c4b39 authored by peay's avatar peay

Re-generate code and API spec for CronJob API

parent 2b33de06
...@@ -40977,6 +40977,11 @@ ...@@ -40977,6 +40977,11 @@
"description": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.", "description": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.",
"type": "string" "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": { "jobTemplate": {
"description": "JobTemplate is the object that describes the job that will be created when executing a CronJob.", "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" "$ref": "#/definitions/io.k8s.kubernetes.pkg.apis.batch.v2alpha1.JobTemplateSpec"
...@@ -40990,6 +40995,11 @@ ...@@ -40990,6 +40995,11 @@
"type": "integer", "type": "integer",
"format": "int64" "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": { "suspend": {
"description": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.", "description": "Suspend flag tells the controller to suspend subsequent executions, it does not apply to already started executions. Defaults to false.",
"type": "boolean" "type": "boolean"
...@@ -82,6 +82,16 @@ message CronJobSpec { ...@@ -82,6 +82,16 @@ message CronJobSpec {
// JobTemplate is the object that describes the job that will be created when // JobTemplate is the object that describes the job that will be created when
// executing a CronJob. // executing a CronJob.
optional JobTemplateSpec jobTemplate = 5; 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. // CronJobStatus represents the current state of a cron job.
......
...@@ -3793,15 +3793,17 @@ func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { ...@@ -3793,15 +3793,17 @@ func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
} else { } else {
yysep2 := !z.EncBinary() yysep2 := !z.EncBinary()
yy2arr2 := z.EncBasicHandle().StructToArray yy2arr2 := z.EncBasicHandle().StructToArray
var yyq2 [5]bool var yyq2 [7]bool
_, _, _ = yysep2, yyq2, yy2arr2 _, _, _ = yysep2, yyq2, yy2arr2
const yyr2 bool = false const yyr2 bool = false
yyq2[1] = x.StartingDeadlineSeconds != nil yyq2[1] = x.StartingDeadlineSeconds != nil
yyq2[2] = x.ConcurrencyPolicy != "" yyq2[2] = x.ConcurrencyPolicy != ""
yyq2[3] = x.Suspend != nil yyq2[3] = x.Suspend != nil
yyq2[5] = x.SuccessfulJobsHistoryLimit != nil
yyq2[6] = x.FailedJobsHistoryLimit != nil
var yynn2 int var yynn2 int
if yyr2 || yy2arr2 { if yyr2 || yy2arr2 {
r.EncodeArrayStart(5) r.EncodeArrayStart(7)
} else { } else {
yynn2 = 2 yynn2 = 2
for _, b := range yyq2 { for _, b := range yyq2 {
...@@ -3928,6 +3930,76 @@ func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) { ...@@ -3928,6 +3930,76 @@ func (x *CronJobSpec) CodecEncodeSelf(e *codec1978.Encoder) {
yy22.CodecEncodeSelf(e) yy22.CodecEncodeSelf(e)
} }
if yyr2 || yy2arr2 { 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) z.EncSendContainerState(codecSelfer_containerArrayEnd1234)
} else { } else {
z.EncSendContainerState(codecSelfer_containerMapEnd1234) z.EncSendContainerState(codecSelfer_containerMapEnd1234)
...@@ -4046,6 +4118,38 @@ func (x *CronJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { ...@@ -4046,6 +4118,38 @@ func (x *CronJobSpec) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
yyv11 := &x.JobTemplate yyv11 := &x.JobTemplate
yyv11.CodecDecodeSelf(d) 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: default:
z.DecStructFieldNotFound(-1, yys3) z.DecStructFieldNotFound(-1, yys3)
} // end switch yys3 } // end switch yys3
...@@ -4057,16 +4161,16 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -4057,16 +4161,16 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234 var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj12 int var yyj16 int
var yyb12 bool var yyb16 bool
var yyhl12 bool = l >= 0 var yyhl16 bool = l >= 0
yyj12++ yyj16++
if yyhl12 { if yyhl16 {
yyb12 = yyj12 > l yyb16 = yyj16 > l
} else { } else {
yyb12 = r.CheckBreak() yyb16 = r.CheckBreak()
} }
if yyb12 { if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
...@@ -4074,21 +4178,21 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -4074,21 +4178,21 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.Schedule = "" x.Schedule = ""
} else { } else {
yyv13 := &x.Schedule yyv17 := &x.Schedule
yym14 := z.DecBinary() yym18 := z.DecBinary()
_ = yym14 _ = yym18
if false { if false {
} else { } else {
*((*string)(yyv13)) = r.DecodeString() *((*string)(yyv17)) = r.DecodeString()
} }
} }
yyj12++ yyj16++
if yyhl12 { if yyhl16 {
yyb12 = yyj12 > l yyb16 = yyj16 > l
} else { } else {
yyb12 = r.CheckBreak() yyb16 = r.CheckBreak()
} }
if yyb12 { if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
...@@ -4101,20 +4205,20 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -4101,20 +4205,20 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.StartingDeadlineSeconds == nil { if x.StartingDeadlineSeconds == nil {
x.StartingDeadlineSeconds = new(int64) x.StartingDeadlineSeconds = new(int64)
} }
yym16 := z.DecBinary() yym20 := z.DecBinary()
_ = yym16 _ = yym20
if false { if false {
} else { } else {
*((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64)) *((*int64)(x.StartingDeadlineSeconds)) = int64(r.DecodeInt(64))
} }
} }
yyj12++ yyj16++
if yyhl12 { if yyhl16 {
yyb12 = yyj12 > l yyb16 = yyj16 > l
} else { } else {
yyb12 = r.CheckBreak() yyb16 = r.CheckBreak()
} }
if yyb12 { if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
...@@ -4122,16 +4226,16 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -4122,16 +4226,16 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.ConcurrencyPolicy = "" x.ConcurrencyPolicy = ""
} else { } else {
yyv17 := &x.ConcurrencyPolicy yyv21 := &x.ConcurrencyPolicy
yyv17.CodecDecodeSelf(d) yyv21.CodecDecodeSelf(d)
} }
yyj12++ yyj16++
if yyhl12 { if yyhl16 {
yyb12 = yyj12 > l yyb16 = yyj16 > l
} else { } else {
yyb12 = r.CheckBreak() yyb16 = r.CheckBreak()
} }
if yyb12 { if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
...@@ -4144,20 +4248,20 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -4144,20 +4248,20 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if x.Suspend == nil { if x.Suspend == nil {
x.Suspend = new(bool) x.Suspend = new(bool)
} }
yym19 := z.DecBinary() yym23 := z.DecBinary()
_ = yym19 _ = yym23
if false { if false {
} else { } else {
*((*bool)(x.Suspend)) = r.DecodeBool() *((*bool)(x.Suspend)) = r.DecodeBool()
} }
} }
yyj12++ yyj16++
if yyhl12 { if yyhl16 {
yyb12 = yyj12 > l yyb16 = yyj16 > l
} else { } else {
yyb12 = r.CheckBreak() yyb16 = r.CheckBreak()
} }
if yyb12 { if yyb16 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return return
} }
...@@ -4165,21 +4269,73 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { ...@@ -4165,21 +4269,73 @@ func (x *CronJobSpec) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() { if r.TryDecodeAsNil() {
x.JobTemplate = JobTemplateSpec{} x.JobTemplate = JobTemplateSpec{}
} else { } else {
yyv20 := &x.JobTemplate yyv24 := &x.JobTemplate
yyv20.CodecDecodeSelf(d) 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 { for {
yyj12++ yyj16++
if yyhl12 { if yyhl16 {
yyb12 = yyj12 > l yyb16 = yyj16 > l
} else { } else {
yyb12 = r.CheckBreak() yyb16 = r.CheckBreak()
} }
if yyb12 { if yyb16 {
break break
} }
z.DecSendContainerState(codecSelfer_containerArrayElem1234) z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj12-1, "") z.DecStructFieldNotFound(yyj16-1, "")
} }
z.DecSendContainerState(codecSelfer_containerArrayEnd1234) z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
} }
...@@ -4772,7 +4928,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) { ...@@ -4772,7 +4928,7 @@ func (x codecSelfer1234) decSliceCronJob(v *[]CronJob, d *codec1978.Decoder) {
yyrg1 := len(yyv1) > 0 yyrg1 := len(yyv1) > 0
yyv21 := yyv1 yyv21 := yyv1
yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 1128) yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 1144)
if yyrt1 { if yyrt1 {
if yyrl1 <= cap(yyv1) { if yyrl1 <= cap(yyv1) {
yyv1 = yyv1[:yyrl1] yyv1 = yyv1[:yyrl1]
......
...@@ -55,6 +55,8 @@ var map_CronJobSpec = map[string]string{ ...@@ -55,6 +55,8 @@ var map_CronJobSpec = map[string]string{
"concurrencyPolicy": "ConcurrencyPolicy specifies how to treat concurrent executions of a Job.", "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.", "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.", "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 { func (CronJobSpec) SwaggerDoc() map[string]string {
......
...@@ -141,6 +141,8 @@ func autoConvert_v2alpha1_CronJobSpec_To_batch_CronJobSpec(in *CronJobSpec, out ...@@ -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 { if err := Convert_v2alpha1_JobTemplateSpec_To_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil {
return err return err
} }
out.SuccessfulJobsHistoryLimit = (*int32)(unsafe.Pointer(in.SuccessfulJobsHistoryLimit))
out.FailedJobsHistoryLimit = (*int32)(unsafe.Pointer(in.FailedJobsHistoryLimit))
return nil return nil
} }
...@@ -156,6 +158,8 @@ func autoConvert_batch_CronJobSpec_To_v2alpha1_CronJobSpec(in *batch.CronJobSpec ...@@ -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 { if err := Convert_batch_JobTemplateSpec_To_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, s); err != nil {
return err return err
} }
out.SuccessfulJobsHistoryLimit = (*int32)(unsafe.Pointer(in.SuccessfulJobsHistoryLimit))
out.FailedJobsHistoryLimit = (*int32)(unsafe.Pointer(in.FailedJobsHistoryLimit))
return nil return nil
} }
......
...@@ -106,6 +106,16 @@ func DeepCopy_v2alpha1_CronJobSpec(in interface{}, out interface{}, c *conversio ...@@ -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 { if err := DeepCopy_v2alpha1_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil {
return err 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 return nil
} }
} }
......
...@@ -106,6 +106,16 @@ func DeepCopy_batch_CronJobSpec(in interface{}, out interface{}, c *conversion.C ...@@ -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 { if err := DeepCopy_batch_JobTemplateSpec(&in.JobTemplate, &out.JobTemplate, c); err != nil {
return err 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 return nil
} }
} }
......
...@@ -16189,6 +16189,20 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope ...@@ -16189,6 +16189,20 @@ func GetOpenAPIDefinitions(ref openapi.ReferenceCallback) map[string]openapi.Ope
Ref: ref("k8s.io/kubernetes/pkg/apis/batch/v2alpha1.JobTemplateSpec"), 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"}, 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