Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
53c3e103
Commit
53c3e103
authored
Aug 25, 2018
by
goodluckbot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pastBackoffLimitOnFailure when backoffLimit is zero
parent
1da4c59e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
job_controller.go
pkg/controller/job/job_controller.go
+3
-0
job_controller_test.go
pkg/controller/job/job_controller_test.go
+15
-0
No files found.
pkg/controller/job/job_controller.go
View file @
53c3e103
...
...
@@ -643,6 +643,9 @@ func pastBackoffLimitOnFailure(job *batch.Job, pods []*v1.Pod) bool {
result
+=
stat
.
RestartCount
}
}
if
*
job
.
Spec
.
BackoffLimit
==
0
{
return
result
>
0
}
return
result
>=
*
job
.
Spec
.
BackoffLimit
}
...
...
pkg/controller/job/job_controller_test.go
View file @
53c3e103
...
...
@@ -1422,6 +1422,21 @@ func TestJobBackoffForOnFailure(t *testing.T) {
expectedCondition
*
batch
.
JobConditionType
expectedConditionReason
string
}{
"backoffLimit 0 should have 1 pod active"
:
{
1
,
1
,
0
,
true
,
[]
int32
{
0
},
1
,
0
,
0
,
nil
,
""
,
},
"backoffLimit 1 with restartCount 0 should have 1 pod active"
:
{
1
,
1
,
1
,
true
,
[]
int32
{
0
},
1
,
0
,
0
,
nil
,
""
,
},
"backoffLimit 1 with restartCount 1 should have 0 pod active"
:
{
1
,
1
,
1
,
true
,
[]
int32
{
1
},
0
,
0
,
1
,
&
jobConditionFailed
,
"BackoffLimitExceeded"
,
},
"too many job failures - single pod"
:
{
1
,
5
,
2
,
true
,
[]
int32
{
2
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment