mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Merge pull request #126567 from fusida/refactor-job-controller
support the job controller handles the orphan pod using multi workers
This commit is contained in:
@@ -232,10 +232,9 @@ func (jm *Controller) Run(ctx context.Context, workers int) {
|
||||
|
||||
for i := 0; i < workers; i++ {
|
||||
go wait.UntilWithContext(ctx, jm.worker, time.Second)
|
||||
go wait.UntilWithContext(ctx, jm.orphanWorker, time.Second)
|
||||
}
|
||||
|
||||
go wait.UntilWithContext(ctx, jm.orphanWorker, time.Second)
|
||||
|
||||
<-ctx.Done()
|
||||
}
|
||||
|
||||
|
||||
@@ -7627,6 +7627,8 @@ func TestFinalizerCleanup(t *testing.T) {
|
||||
// Initialize the controller with 0 workers to make sure the
|
||||
// pod finalizers are not removed by the "syncJob" function.
|
||||
go manager.Run(ctx, 0)
|
||||
// Make sure the pod finalizers are removed by the "orphanWorker" function.
|
||||
go wait.UntilWithContext(ctx, manager.orphanWorker, time.Second)
|
||||
|
||||
// Create a simple Job
|
||||
job := newJob(1, 1, 1, batch.NonIndexedCompletion)
|
||||
|
||||
Reference in New Issue
Block a user