Clean shutdown of kcm, ccm and scheduler

This commit is contained in:
Wojciech Tyczyński
2022-05-25 10:00:06 +02:00
parent 55130ae2ab
commit fe3616cafb
10 changed files with 72 additions and 38 deletions

View File

@@ -1444,7 +1444,10 @@ func initTestPreferNominatedNode(t *testing.T, nsPrefix string, opts ...schedule
f := testCtx.Scheduler.NextPod
testCtx.Scheduler.NextPod = func() (podInfo *framework.QueuedPodInfo) {
podInfo = f()
podInfo.Pod.Status.NominatedNodeName = "node-1"
// Scheduler.Next() may return nil when scheduler is shutting down.
if podInfo != nil {
podInfo.Pod.Status.NominatedNodeName = "node-1"
}
return podInfo
}
go testCtx.Scheduler.Run(testCtx.Ctx)