mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
Merge pull request #121147 from kannon92/rm-at-least-no-terminating-count
Remove terminating count from rmAtLeast
This commit is contained in:
commit
6d70013af5
@ -1494,7 +1494,7 @@ func (jm *Controller) manageJob(ctx context.Context, job *batch.Job, jobCtx *syn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rmAtLeast := active + terminating - wantActive
|
rmAtLeast := active - wantActive
|
||||||
if rmAtLeast < 0 {
|
if rmAtLeast < 0 {
|
||||||
rmAtLeast = 0
|
rmAtLeast = 0
|
||||||
}
|
}
|
||||||
|
@ -362,9 +362,10 @@ func TestControllerSyncJob(t *testing.T) {
|
|||||||
jobPodReplacementPolicy: true,
|
jobPodReplacementPolicy: true,
|
||||||
terminatingPods: 1,
|
terminatingPods: 1,
|
||||||
expectedTerminating: ptr.To[int32](1),
|
expectedTerminating: ptr.To[int32](1),
|
||||||
expectedPodPatches: 2,
|
// Removes finalizer and deletes one failed pod
|
||||||
expectedDeletions: 1,
|
expectedPodPatches: 1,
|
||||||
expectedFailed: 1,
|
expectedFailed: 1,
|
||||||
|
expectedActive: 1,
|
||||||
},
|
},
|
||||||
"WQ job: turn on PodReplacementPolicy but not set PodReplacementPolicy": {
|
"WQ job: turn on PodReplacementPolicy but not set PodReplacementPolicy": {
|
||||||
parallelism: 1,
|
parallelism: 1,
|
||||||
@ -393,7 +394,20 @@ func TestControllerSyncJob(t *testing.T) {
|
|||||||
expectedPodPatches: 2,
|
expectedPodPatches: 2,
|
||||||
expectedFailed: 2,
|
expectedFailed: 2,
|
||||||
},
|
},
|
||||||
|
"more terminating pods than parallelism": {
|
||||||
|
parallelism: 1,
|
||||||
|
completions: 1,
|
||||||
|
backoffLimit: 6,
|
||||||
|
activePods: 2,
|
||||||
|
failedPods: 0,
|
||||||
|
terminatingPods: 4,
|
||||||
|
podReplacementPolicy: podReplacementPolicy(batch.Failed),
|
||||||
|
jobPodReplacementPolicy: true,
|
||||||
|
expectedTerminating: ptr.To[int32](4),
|
||||||
|
expectedActive: 1,
|
||||||
|
expectedDeletions: 1,
|
||||||
|
expectedPodPatches: 1,
|
||||||
|
},
|
||||||
"too few active pods and active back-off": {
|
"too few active pods and active back-off": {
|
||||||
parallelism: 1,
|
parallelism: 1,
|
||||||
completions: 1,
|
completions: 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user