From 3989b18586203eb366257fa4c8e9c0d605ec41df Mon Sep 17 00:00:00 2001 From: cedric lamoriniere Date: Wed, 16 Aug 2017 16:05:32 +0200 Subject: [PATCH 1/2] update API v1 Job object Add new fields in api v1.JobSpec object for backoff policy - BackoffLimit - FailedPodsLimit fixes: https://github.com/kubernetes/community/pull/583 --- pkg/apis/batch/fuzzer/fuzzer.go | 2 + pkg/apis/batch/types.go | 10 ++ pkg/apis/batch/v1/conversion.go | 2 + pkg/apis/batch/v1/defaults.go | 4 + pkg/apis/batch/v1/defaults_test.go | 111 ++++++++++++++--------- pkg/apis/batch/validation/validation.go | 3 + staging/src/k8s.io/api/batch/v1/types.go | 12 ++- test/e2e_federation/job.go | 1 + 8 files changed, 102 insertions(+), 43 deletions(-) diff --git a/pkg/apis/batch/fuzzer/fuzzer.go b/pkg/apis/batch/fuzzer/fuzzer.go index cb4b751f6d1..07a8cc1ed59 100644 --- a/pkg/apis/batch/fuzzer/fuzzer.go +++ b/pkg/apis/batch/fuzzer/fuzzer.go @@ -36,8 +36,10 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { c.FuzzNoCustom(j) // fuzz self without calling this function again completions := int32(c.Rand.Int31()) parallelism := int32(c.Rand.Int31()) + backoffLimit := int32(c.Rand.Int31()) j.Completions = &completions j.Parallelism = ¶llelism + j.BackoffLimit = &backoffLimit if c.Rand.Int31()%2 == 0 { j.ManualSelector = newBool(true) } else { diff --git a/pkg/apis/batch/types.go b/pkg/apis/batch/types.go index 7b450d4ffd1..be2b692f296 100644 --- a/pkg/apis/batch/types.go +++ b/pkg/apis/batch/types.go @@ -109,6 +109,16 @@ type JobSpec struct { // +optional ActiveDeadlineSeconds *int64 + // Optional number of retries before marking this job failed. + // Defaults to 6 + // +optional + BackoffLimit *int32 + + // TODO enabled it when https://github.com/kubernetes/kubernetes/issues/28486 has been fixed + // Optional number of failed pods to retain. + // +optional + // FailedPodsLimit *int32 + // A label query over pods that should match the pod count. // Normally, the system sets this field for you. // +optional diff --git a/pkg/apis/batch/v1/conversion.go b/pkg/apis/batch/v1/conversion.go index 55215676cc1..941b61d4a70 100644 --- a/pkg/apis/batch/v1/conversion.go +++ b/pkg/apis/batch/v1/conversion.go @@ -53,6 +53,7 @@ func Convert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *batchv1.JobSpec out.Parallelism = in.Parallelism out.Completions = in.Completions out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds + out.BackoffLimit = in.BackoffLimit out.Selector = in.Selector if in.ManualSelector != nil { out.ManualSelector = new(bool) @@ -71,6 +72,7 @@ func Convert_v1_JobSpec_To_batch_JobSpec(in *batchv1.JobSpec, out *batch.JobSpec out.Parallelism = in.Parallelism out.Completions = in.Completions out.ActiveDeadlineSeconds = in.ActiveDeadlineSeconds + out.BackoffLimit = in.BackoffLimit out.Selector = in.Selector if in.ManualSelector != nil { out.ManualSelector = new(bool) diff --git a/pkg/apis/batch/v1/defaults.go b/pkg/apis/batch/v1/defaults.go index 0d2af9e6aca..72e7e2a9d5b 100644 --- a/pkg/apis/batch/v1/defaults.go +++ b/pkg/apis/batch/v1/defaults.go @@ -38,6 +38,10 @@ func SetDefaults_Job(obj *batchv1.Job) { obj.Spec.Parallelism = new(int32) *obj.Spec.Parallelism = 1 } + if obj.Spec.BackoffLimit == nil { + obj.Spec.BackoffLimit = new(int32) + *obj.Spec.BackoffLimit = 6 + } labels := obj.Spec.Template.Labels if labels != nil && len(obj.Labels) == 0 { obj.Labels = labels diff --git a/pkg/apis/batch/v1/defaults_test.go b/pkg/apis/batch/v1/defaults_test.go index d1d48b1666f..f19ac542a5c 100644 --- a/pkg/apis/batch/v1/defaults_test.go +++ b/pkg/apis/batch/v1/defaults_test.go @@ -38,7 +38,7 @@ func TestSetDefaultJob(t *testing.T) { expected *batchv1.Job expectLabels bool }{ - "both unspecified -> sets both to 1": { + "All unspecified -> sets all to default values": { original: &batchv1.Job{ Spec: batchv1.JobSpec{ Template: v1.PodTemplateSpec{ @@ -48,13 +48,14 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(1), - Parallelism: newInt32(1), + Completions: newInt32(1), + Parallelism: newInt32(1), + BackoffLimit: newInt32(6), }, }, expectLabels: true, }, - "both unspecified -> sets both to 1 and no default labels": { + "All unspecified -> all integers are defaulted and no default labels": { original: &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{"mylabel": "myvalue"}, @@ -67,12 +68,13 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(1), - Parallelism: newInt32(1), + Completions: newInt32(1), + Parallelism: newInt32(1), + BackoffLimit: newInt32(6), }, }, }, - "WQ: Parallelism explicitly 0 and completions unset -> no change": { + "WQ: Parallelism explicitly 0 and completions unset -> BackoffLimit is defaulted": { original: &batchv1.Job{ Spec: batchv1.JobSpec{ Parallelism: newInt32(0), @@ -83,12 +85,13 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Parallelism: newInt32(0), + Parallelism: newInt32(0), + BackoffLimit: newInt32(6), }, }, expectLabels: true, }, - "WQ: Parallelism explicitly 2 and completions unset -> no change": { + "WQ: Parallelism explicitly 2 and completions unset -> BackoffLimit is defaulted": { original: &batchv1.Job{ Spec: batchv1.JobSpec{ Parallelism: newInt32(2), @@ -99,12 +102,13 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Parallelism: newInt32(2), + Parallelism: newInt32(2), + BackoffLimit: newInt32(6), }, }, expectLabels: true, }, - "Completions explicitly 2 and parallelism unset -> parallelism is defaulted": { + "Completions explicitly 2 and others unset -> parallelism and BackoffLimit are defaulted": { original: &batchv1.Job{ Spec: batchv1.JobSpec{ Completions: newInt32(2), @@ -115,17 +119,17 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(2), - Parallelism: newInt32(1), + Completions: newInt32(2), + Parallelism: newInt32(1), + BackoffLimit: newInt32(6), }, }, expectLabels: true, }, - "Both set -> no change": { + "BackoffLimit explicitly 5 and others unset -> parallelism and completions are defaulted": { original: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(10), - Parallelism: newInt32(11), + BackoffLimit: newInt32(5), Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{Labels: defaultLabels}, }, @@ -133,20 +137,19 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(10), - Parallelism: newInt32(11), - Template: v1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{Labels: defaultLabels}, - }, + Completions: newInt32(1), + Parallelism: newInt32(1), + BackoffLimit: newInt32(5), }, }, expectLabels: true, }, - "Both set, flipped -> no change": { + "All set -> no change": { original: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(11), - Parallelism: newInt32(10), + Completions: newInt32(8), + Parallelism: newInt32(9), + BackoffLimit: newInt32(10), Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{Labels: defaultLabels}, }, @@ -154,8 +157,32 @@ func TestSetDefaultJob(t *testing.T) { }, expected: &batchv1.Job{ Spec: batchv1.JobSpec{ - Completions: newInt32(11), - Parallelism: newInt32(10), + Completions: newInt32(8), + Parallelism: newInt32(9), + BackoffLimit: newInt32(10), + Template: v1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{Labels: defaultLabels}, + }, + }, + }, + expectLabels: true, + }, + "All set, flipped -> no change": { + original: &batchv1.Job{ + Spec: batchv1.JobSpec{ + Completions: newInt32(11), + Parallelism: newInt32(10), + BackoffLimit: newInt32(9), + Template: v1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{Labels: defaultLabels}, + }, + }, + }, + expected: &batchv1.Job{ + Spec: batchv1.JobSpec{ + Completions: newInt32(11), + Parallelism: newInt32(10), + BackoffLimit: newInt32(9), }, }, expectLabels: true, @@ -171,22 +198,11 @@ func TestSetDefaultJob(t *testing.T) { t.Errorf("%s: unexpected object: %v", name, actual) t.FailNow() } - if (actual.Spec.Completions == nil) != (expected.Spec.Completions == nil) { - t.Errorf("%s: got different *completions than expected: %v %v", name, actual.Spec.Completions, expected.Spec.Completions) - } - if actual.Spec.Completions != nil && expected.Spec.Completions != nil { - if *actual.Spec.Completions != *expected.Spec.Completions { - t.Errorf("%s: got different completions than expected: %d %d", name, *actual.Spec.Completions, *expected.Spec.Completions) - } - } - if (actual.Spec.Parallelism == nil) != (expected.Spec.Parallelism == nil) { - t.Errorf("%s: got different *Parallelism than expected: %v %v", name, actual.Spec.Parallelism, expected.Spec.Parallelism) - } - if actual.Spec.Parallelism != nil && expected.Spec.Parallelism != nil { - if *actual.Spec.Parallelism != *expected.Spec.Parallelism { - t.Errorf("%s: got different parallelism than expected: %d %d", name, *actual.Spec.Parallelism, *expected.Spec.Parallelism) - } - } + + validateDefaultInt32(t, name, "Completions", actual.Spec.Completions, expected.Spec.Completions) + validateDefaultInt32(t, name, "Parallelism", actual.Spec.Parallelism, expected.Spec.Parallelism) + validateDefaultInt32(t, name, "BackoffLimit", actual.Spec.BackoffLimit, expected.Spec.BackoffLimit) + if test.expectLabels != reflect.DeepEqual(actual.Labels, actual.Spec.Template.Labels) { if test.expectLabels { t.Errorf("%s: expected: %v, got: %v", name, actual.Spec.Template.Labels, actual.Labels) @@ -198,6 +214,17 @@ func TestSetDefaultJob(t *testing.T) { } } +func validateDefaultInt32(t *testing.T, name string, field string, actual *int32, expected *int32) { + if (actual == nil) != (expected == nil) { + t.Errorf("%s: got different *%s than expected: %v %v", name, field, actual, expected) + } + if actual != nil && expected != nil { + if *actual != *expected { + t.Errorf("%s: got different %s than expected: %d %d", name, field, *actual, *expected) + } + } +} + func roundTrip(t *testing.T, obj runtime.Object) runtime.Object { data, err := runtime.Encode(api.Codecs.LegacyCodec(SchemeGroupVersion), obj) if err != nil { diff --git a/pkg/apis/batch/validation/validation.go b/pkg/apis/batch/validation/validation.go index 77ab204e4a7..c736c10fbd4 100644 --- a/pkg/apis/batch/validation/validation.go +++ b/pkg/apis/batch/validation/validation.go @@ -113,6 +113,9 @@ func validateJobSpec(spec *batch.JobSpec, fldPath *field.Path) field.ErrorList { if spec.ActiveDeadlineSeconds != nil { allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(*spec.ActiveDeadlineSeconds), fldPath.Child("activeDeadlineSeconds"))...) } + if spec.BackoffLimit != nil { + allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(*spec.BackoffLimit), fldPath.Child("backoffLimit"))...) + } allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(&spec.Template, fldPath.Child("template"))...) if spec.Template.Spec.RestartPolicy != api.RestartPolicyOnFailure && diff --git a/staging/src/k8s.io/api/batch/v1/types.go b/staging/src/k8s.io/api/batch/v1/types.go index 7124e0719f0..4f3b83e8a8d 100644 --- a/staging/src/k8s.io/api/batch/v1/types.go +++ b/staging/src/k8s.io/api/batch/v1/types.go @@ -77,11 +77,21 @@ type JobSpec struct { // +optional Completions *int32 `json:"completions,omitempty" protobuf:"varint,2,opt,name=completions"` - // Optional duration in seconds relative to the startTime that the job may be active + // Specifies the duration in seconds relative to the startTime that the job may be active // before the system tries to terminate it; value must be positive integer // +optional ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,3,opt,name=activeDeadlineSeconds"` + // Specifies the number of retries before marking this job failed. + // Defaults to 6 + // +optional + BackoffLimit *int32 `json:"backoffLimit,omitempty" protobuf:"varint,7,opt,name=backoffLimit"` + + // TODO enabled it when https://github.com/kubernetes/kubernetes/issues/28486 has been fixed + // Optional number of failed pods to retain. + // +optional + // FailedPodsLimit *int32 `json:"failedPodsLimit,omitempty" protobuf:"varint,9,opt,name=failedPodsLimit"` + // A label query over pods that should match the pod count. // Normally, the system sets this field for you. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors diff --git a/test/e2e_federation/job.go b/test/e2e_federation/job.go index 71ad152ba4b..d84a8bb2821 100644 --- a/test/e2e_federation/job.go +++ b/test/e2e_federation/job.go @@ -225,6 +225,7 @@ func verifyJob(fedJob, localJob *batchv1.Job) bool { localJob.Spec.ManualSelector = fedJob.Spec.ManualSelector localJob.Spec.Completions = fedJob.Spec.Completions localJob.Spec.Parallelism = fedJob.Spec.Parallelism + localJob.Spec.BackoffLimit = fedJob.Spec.BackoffLimit return fedutil.ObjectMetaAndSpecEquivalent(fedJob, localJob) } From 228693622b09e704bb2e4831c7c5f7f8966ad0f5 Mon Sep 17 00:00:00 2001 From: cedric lamoriniere Date: Fri, 1 Sep 2017 21:01:48 +0200 Subject: [PATCH 2/2] Generate files from v1.JobSpec modification This commit contains the new version of generated api files linked to the v1.JobSpec modifications in the previous commit after "make update" --- api/openapi-spec/swagger.json | 7 +- api/swagger-spec/batch_v1.json | 7 +- api/swagger-spec/batch_v1beta1.json | 7 +- api/swagger-spec/batch_v2alpha1.json | 7 +- docs/api-reference/batch/v1/definitions.html | 9 +- .../batch/v1beta1/definitions.html | 9 +- .../batch/v2alpha1/definitions.html | 9 +- pkg/apis/batch/v1/zz_generated.conversion.go | 2 + pkg/apis/batch/zz_generated.deepcopy.go | 9 ++ .../src/k8s.io/api/batch/v1/generated.pb.go | 142 +++++++++++------- .../src/k8s.io/api/batch/v1/generated.proto | 7 +- .../batch/v1/types_swagger_doc_generated.go | 3 +- .../api/batch/v1/zz_generated.deepcopy.go | 9 ++ 13 files changed, 162 insertions(+), 65 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index a96a6fe2e57..eac94c857f7 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -57557,10 +57557,15 @@ ], "properties": { "activeDeadlineSeconds": { - "description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer", + "description": "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer", "type": "integer", "format": "int64" }, + "backoffLimit": { + "description": "Specifies the number of retries before marking this job failed. Defaults to 6", + "type": "integer", + "format": "int32" + }, "completions": { "description": "Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "type": "integer", diff --git a/api/swagger-spec/batch_v1.json b/api/swagger-spec/batch_v1.json index 55881d93ae3..6ec2b47b62b 100644 --- a/api/swagger-spec/batch_v1.json +++ b/api/swagger-spec/batch_v1.json @@ -1385,7 +1385,12 @@ "activeDeadlineSeconds": { "type": "integer", "format": "int64", - "description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" + "description": "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" + }, + "backoffLimit": { + "type": "integer", + "format": "int32", + "description": "Specifies the number of retries before marking this job failed. Defaults to 6" }, "selector": { "$ref": "v1.LabelSelector", diff --git a/api/swagger-spec/batch_v1beta1.json b/api/swagger-spec/batch_v1beta1.json index 1e36b31258d..346c89a8da3 100644 --- a/api/swagger-spec/batch_v1beta1.json +++ b/api/swagger-spec/batch_v1beta1.json @@ -1440,7 +1440,12 @@ "activeDeadlineSeconds": { "type": "integer", "format": "int64", - "description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" + "description": "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" + }, + "backoffLimit": { + "type": "integer", + "format": "int32", + "description": "Specifies the number of retries before marking this job failed. Defaults to 6" }, "selector": { "$ref": "v1.LabelSelector", diff --git a/api/swagger-spec/batch_v2alpha1.json b/api/swagger-spec/batch_v2alpha1.json index 9b11dd93614..dc93e6af89f 100644 --- a/api/swagger-spec/batch_v2alpha1.json +++ b/api/swagger-spec/batch_v2alpha1.json @@ -1440,7 +1440,12 @@ "activeDeadlineSeconds": { "type": "integer", "format": "int64", - "description": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" + "description": "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer" + }, + "backoffLimit": { + "type": "integer", + "format": "int32", + "description": "Specifies the number of retries before marking this job failed. Defaults to 6" }, "selector": { "$ref": "v1.LabelSelector", diff --git a/docs/api-reference/batch/v1/definitions.html b/docs/api-reference/batch/v1/definitions.html index ece4739513c..060980901a5 100755 --- a/docs/api-reference/batch/v1/definitions.html +++ b/docs/api-reference/batch/v1/definitions.html @@ -2396,12 +2396,19 @@ When an object is created, the system will populate this list with the current s

activeDeadlineSeconds

-

Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

+

Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

false

integer (int64)

+

backoffLimit

+

Specifies the number of retries before marking this job failed. Defaults to 6

+

false

+

integer (int32)

+ + +

selector

A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

false

diff --git a/docs/api-reference/batch/v1beta1/definitions.html b/docs/api-reference/batch/v1beta1/definitions.html index cf400c551b1..3c509dd7e55 100755 --- a/docs/api-reference/batch/v1beta1/definitions.html +++ b/docs/api-reference/batch/v1beta1/definitions.html @@ -2430,12 +2430,19 @@ When an object is created, the system will populate this list with the current s

activeDeadlineSeconds

-

Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

+

Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

false

integer (int64)

+

backoffLimit

+

Specifies the number of retries before marking this job failed. Defaults to 6

+

false

+

integer (int32)

+ + +

selector

A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

false

diff --git a/docs/api-reference/batch/v2alpha1/definitions.html b/docs/api-reference/batch/v2alpha1/definitions.html index 5958149dc2a..65f1e9344c9 100755 --- a/docs/api-reference/batch/v2alpha1/definitions.html +++ b/docs/api-reference/batch/v2alpha1/definitions.html @@ -2403,12 +2403,19 @@ When an object is created, the system will populate this list with the current s

activeDeadlineSeconds

-

Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

+

Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer

false

integer (int64)

+

backoffLimit

+

Specifies the number of retries before marking this job failed. Defaults to 6

+

false

+

integer (int32)

+ + +

selector

A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors

false

diff --git a/pkg/apis/batch/v1/zz_generated.conversion.go b/pkg/apis/batch/v1/zz_generated.conversion.go index 015a0f76a41..487b9c63ab8 100644 --- a/pkg/apis/batch/v1/zz_generated.conversion.go +++ b/pkg/apis/batch/v1/zz_generated.conversion.go @@ -161,6 +161,7 @@ func autoConvert_v1_JobSpec_To_batch_JobSpec(in *v1.JobSpec, out *batch.JobSpec, out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) out.Completions = (*int32)(unsafe.Pointer(in.Completions)) out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.BackoffLimit = (*int32)(unsafe.Pointer(in.BackoffLimit)) out.Selector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.Selector)) out.ManualSelector = (*bool)(unsafe.Pointer(in.ManualSelector)) if err := api_v1.Convert_v1_PodTemplateSpec_To_api_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { @@ -173,6 +174,7 @@ func autoConvert_batch_JobSpec_To_v1_JobSpec(in *batch.JobSpec, out *v1.JobSpec, out.Parallelism = (*int32)(unsafe.Pointer(in.Parallelism)) out.Completions = (*int32)(unsafe.Pointer(in.Completions)) out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) + out.BackoffLimit = (*int32)(unsafe.Pointer(in.BackoffLimit)) out.Selector = (*meta_v1.LabelSelector)(unsafe.Pointer(in.Selector)) out.ManualSelector = (*bool)(unsafe.Pointer(in.ManualSelector)) if err := api_v1.Convert_api_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { diff --git a/pkg/apis/batch/zz_generated.deepcopy.go b/pkg/apis/batch/zz_generated.deepcopy.go index 10d4b5f15de..483452c09e0 100644 --- a/pkg/apis/batch/zz_generated.deepcopy.go +++ b/pkg/apis/batch/zz_generated.deepcopy.go @@ -342,6 +342,15 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) { **out = **in } } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + if *in == nil { + *out = nil + } else { + *out = new(int32) + **out = **in + } + } if in.Selector != nil { in, out := &in.Selector, &out.Selector if *in == nil { diff --git a/staging/src/k8s.io/api/batch/v1/generated.pb.go b/staging/src/k8s.io/api/batch/v1/generated.pb.go index ace57748b83..5909ab76633 100644 --- a/staging/src/k8s.io/api/batch/v1/generated.pb.go +++ b/staging/src/k8s.io/api/batch/v1/generated.pb.go @@ -271,6 +271,11 @@ func (m *JobSpec) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n8 + if m.BackoffLimit != nil { + dAtA[i] = 0x38 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(*m.BackoffLimit)) + } return i, nil } @@ -425,6 +430,9 @@ func (m *JobSpec) Size() (n int) { } l = m.Template.Size() n += 1 + l + sovGenerated(uint64(l)) + if m.BackoffLimit != nil { + n += 1 + sovGenerated(uint64(*m.BackoffLimit)) + } return n } @@ -513,6 +521,7 @@ func (this *JobSpec) String() string { `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`, `ManualSelector:` + valueToStringGenerated(this.ManualSelector) + `,`, `Template:` + strings.Replace(strings.Replace(this.Template.String(), "PodTemplateSpec", "k8s_io_api_core_v1.PodTemplateSpec", 1), `&`, ``, 1) + `,`, + `BackoffLimit:` + valueToStringGenerated(this.BackoffLimit) + `,`, `}`, }, "") return s @@ -1190,6 +1199,26 @@ func (m *JobSpec) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BackoffLimit", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.BackoffLimit = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -1525,61 +1554,62 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 882 bytes of a gzipped FileDescriptorProto + // 907 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6f, 0xe3, 0x44, - 0x18, 0x8d, 0x9b, 0xa6, 0x4d, 0x26, 0x6d, 0x77, 0x19, 0x54, 0x29, 0x54, 0xc8, 0x59, 0x82, 0x84, - 0x0a, 0x12, 0x36, 0xe9, 0x56, 0x08, 0x21, 0x40, 0xc2, 0x45, 0x2b, 0x51, 0xb5, 0xda, 0x32, 0x29, - 0x42, 0x42, 0x20, 0x31, 0xb6, 0xbf, 0xa6, 0x43, 0x6d, 0x8f, 0xe5, 0x99, 0x44, 0xea, 0x8d, 0x9f, - 0xc0, 0x8f, 0x40, 0x1c, 0xf9, 0x19, 0xa8, 0xc7, 0x3d, 0xee, 0x29, 0xa2, 0xe6, 0x07, 0x70, 0xdf, - 0x13, 0x9a, 0xf1, 0xc4, 0x76, 0xda, 0x44, 0x74, 0xb9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0xd6, 0x5e, 0xdc, 0x9a, 0xb5, + 0x97, 0xb7, 0x66, 0xed, 0x97, 0xd4, 0x34, 0x6e, 0x52, 0xd3, 0x78, 0x91, 0x9a, 0xc6, 0xcb, 0xd4, + 0x34, 0xfe, 0x4c, 0x4d, 0xe3, 0xd7, 0xbf, 0xcc, 0xda, 0xf7, 0x5b, 0xf3, 0xc1, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xce, 0x80, 0xf2, 0xbe, 0x96, 0x08, 0x00, 0x00, } diff --git a/staging/src/k8s.io/api/batch/v1/generated.proto b/staging/src/k8s.io/api/batch/v1/generated.proto index a54f1466a75..08635ad2b2c 100644 --- a/staging/src/k8s.io/api/batch/v1/generated.proto +++ b/staging/src/k8s.io/api/batch/v1/generated.proto @@ -103,11 +103,16 @@ message JobSpec { // +optional optional int32 completions = 2; - // Optional duration in seconds relative to the startTime that the job may be active + // Specifies the duration in seconds relative to the startTime that the job may be active // before the system tries to terminate it; value must be positive integer // +optional optional int64 activeDeadlineSeconds = 3; + // Specifies the number of retries before marking this job failed. + // Defaults to 6 + // +optional + optional int32 backoffLimit = 7; + // A label query over pods that should match the pod count. // Normally, the system sets this field for you. // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors diff --git a/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go index da4985192c5..53b2d634fd7 100644 --- a/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/batch/v1/types_swagger_doc_generated.go @@ -66,7 +66,8 @@ var map_JobSpec = map[string]string{ "": "JobSpec describes how the job execution will look like.", "parallelism": "Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", "completions": "Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", - "activeDeadlineSeconds": "Optional duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer", + "activeDeadlineSeconds": "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer", + "backoffLimit": "Specifies the number of retries before marking this job failed. Defaults to 6", "selector": "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", "manualSelector": "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://git.k8s.io/community/contributors/design-proposals/selector-generation.md", "template": "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", diff --git a/staging/src/k8s.io/api/batch/v1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/batch/v1/zz_generated.deepcopy.go index 9e692af36de..8738bd5d2c3 100644 --- a/staging/src/k8s.io/api/batch/v1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/batch/v1/zz_generated.deepcopy.go @@ -171,6 +171,15 @@ func (in *JobSpec) DeepCopyInto(out *JobSpec) { **out = **in } } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + if *in == nil { + *out = nil + } else { + *out = new(int32) + **out = **in + } + } if in.Selector != nil { in, out := &in.Selector, &out.Selector if *in == nil {