mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
More Lint Fixes
This commit is contained in:
parent
601679446a
commit
aa9f38c36d
@ -4706,6 +4706,7 @@ func (f *fakeRateLimitingQueue) AddAfter(item interface{}, duration time.Duratio
|
||||
f.item = item
|
||||
f.duration = duration
|
||||
}
|
||||
|
||||
func TestJobBackoff(t *testing.T) {
|
||||
_, ctx := ktesting.NewTestContext(t)
|
||||
logger := klog.FromContext(ctx)
|
||||
@ -4787,47 +4788,58 @@ func TestJobBackoffForOnFailure(t *testing.T) {
|
||||
expectedConditionReason string
|
||||
}{
|
||||
"backoffLimit 0 should have 1 pod active": {
|
||||
1, 1, 0, false, []int32{0}, v1.PodRunning,
|
||||
1, 1, 0,
|
||||
false, []int32{0}, v1.PodRunning,
|
||||
1, 0, 0, nil, "",
|
||||
},
|
||||
"backoffLimit 1 with restartCount 0 should have 1 pod active": {
|
||||
1, 1, 1, false, []int32{0}, v1.PodRunning,
|
||||
1, 1, 1,
|
||||
false, []int32{0}, v1.PodRunning,
|
||||
1, 0, 0, nil, "",
|
||||
},
|
||||
"backoffLimit 1 with restartCount 1 and podRunning should have 0 pod active": {
|
||||
1, 1, 1, false, []int32{1}, v1.PodRunning,
|
||||
1, 1, 1,
|
||||
false, []int32{1}, v1.PodRunning,
|
||||
0, 0, 1, &jobConditionFailed, "BackoffLimitExceeded",
|
||||
},
|
||||
"backoffLimit 1 with restartCount 1 and podPending should have 0 pod active": {
|
||||
1, 1, 1, false, []int32{1}, v1.PodPending,
|
||||
1, 1, 1,
|
||||
false, []int32{1}, v1.PodPending,
|
||||
0, 0, 1, &jobConditionFailed, "BackoffLimitExceeded",
|
||||
},
|
||||
"too many job failures with podRunning - single pod": {
|
||||
1, 5, 2, false, []int32{2}, v1.PodRunning,
|
||||
1, 5, 2,
|
||||
false, []int32{2}, v1.PodRunning,
|
||||
0, 0, 1, &jobConditionFailed, "BackoffLimitExceeded",
|
||||
},
|
||||
"too many job failures with podPending - single pod": {
|
||||
1, 5, 2, false, []int32{2}, v1.PodPending,
|
||||
1, 5, 2,
|
||||
false, []int32{2}, v1.PodPending,
|
||||
0, 0, 1, &jobConditionFailed, "BackoffLimitExceeded",
|
||||
},
|
||||
"too many job failures with podRunning - multiple pods": {
|
||||
2, 5, 2, false, []int32{1, 1}, v1.PodRunning,
|
||||
2, 5, 2,
|
||||
false, []int32{1, 1}, v1.PodRunning,
|
||||
0, 0, 2, &jobConditionFailed, "BackoffLimitExceeded",
|
||||
},
|
||||
"too many job failures with podPending - multiple pods": {
|
||||
2, 5, 2, false, []int32{1, 1}, v1.PodPending,
|
||||
2, 5, 2,
|
||||
false, []int32{1, 1}, v1.PodPending,
|
||||
0, 0, 2, &jobConditionFailed, "BackoffLimitExceeded",
|
||||
},
|
||||
"not enough failures": {
|
||||
2, 5, 3, false, []int32{1, 1}, v1.PodRunning,
|
||||
2, 5, 3,
|
||||
false, []int32{1, 1}, v1.PodRunning,
|
||||
2, 0, 0, nil, "",
|
||||
},
|
||||
"suspending a job": {
|
||||
2, 4, 6, true, []int32{1, 1}, v1.PodRunning,
|
||||
2, 4, 6,
|
||||
true, []int32{1, 1}, v1.PodRunning,
|
||||
0, 0, 0, &jobConditionSuspended, "JobSuspended",
|
||||
},
|
||||
"finshed job": {
|
||||
2, 4, 6, true, []int32{1, 1, 2, 0}, v1.PodSucceeded,
|
||||
2, 4, 6,
|
||||
true, []int32{1, 1, 2, 0}, v1.PodSucceeded,
|
||||
0, 4, 0, &jobConditionComplete, "",
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user