Skip to content

Commit 7196986

Browse files
Fix: Do not reset backoff_limit to 0 when set to 6 (#1968)
* Fix: Allow backoff_limit to have value of 6 Signed-off-by: thatInfrastructureGuy <[email protected]> * add default value of 6 to backoff_limit --------- Signed-off-by: thatInfrastructureGuy <[email protected]> Co-authored-by: Mauricio Alvarez Leon <[email protected]> Co-authored-by: BBBmau <[email protected]>
1 parent 8a51808 commit 7196986

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

kubernetes/schema_job_spec.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func jobSpecFields(specUpdatable bool) map[string]*schema.Schema {
5252
"backoff_limit": {
5353
Type: schema.TypeInt,
5454
Optional: true,
55+
Default: 6,
5556
ForceNew: false,
5657
ValidateFunc: validateNonNegativeInteger,
5758
Description: "Specifies the number of retries before marking this job failed. Defaults to 6",

kubernetes/structure_job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func expandJobSpec(j []interface{}) (batchv1.JobSpec, error) {
7777
obj.ActiveDeadlineSeconds = ptrToInt64(int64(v))
7878
}
7979

80-
if v, ok := in["backoff_limit"].(int); ok && v != 6 {
80+
if v, ok := in["backoff_limit"].(int); ok && v >= 0 {
8181
obj.BackoffLimit = ptrToInt32(int32(v))
8282
}
8383

0 commit comments

Comments
 (0)