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
e6c5fb46
Unverified
Commit
e6c5fb46
authored
Oct 11, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #67859 from goodluckbot/job-controller-backoffLimit
Fix pastBackoffLimitOnFailure in job controller
parents
8f620950
53c3e103
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 @
e6c5fb46
...
@@ -643,6 +643,9 @@ func pastBackoffLimitOnFailure(job *batch.Job, pods []*v1.Pod) bool {
...
@@ -643,6 +643,9 @@ func pastBackoffLimitOnFailure(job *batch.Job, pods []*v1.Pod) bool {
result
+=
stat
.
RestartCount
result
+=
stat
.
RestartCount
}
}
}
}
if
*
job
.
Spec
.
BackoffLimit
==
0
{
return
result
>
0
}
return
result
>=
*
job
.
Spec
.
BackoffLimit
return
result
>=
*
job
.
Spec
.
BackoffLimit
}
}
...
...
pkg/controller/job/job_controller_test.go
View file @
e6c5fb46
...
@@ -1422,6 +1422,21 @@ func TestJobBackoffForOnFailure(t *testing.T) {
...
@@ -1422,6 +1422,21 @@ func TestJobBackoffForOnFailure(t *testing.T) {
expectedCondition
*
batch
.
JobConditionType
expectedCondition
*
batch
.
JobConditionType
expectedConditionReason
string
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"
:
{
"too many job failures - single pod"
:
{
1
,
5
,
2
,
1
,
5
,
2
,
true
,
[]
int32
{
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