mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-08 02:15:27 +00:00
Migrated pkg/scheduler/framework/preemption to use contextual logging
This commit is contained in:
@@ -36,6 +36,7 @@ import (
|
||||
clientsetfake "k8s.io/client-go/kubernetes/fake"
|
||||
clienttesting "k8s.io/client-go/testing"
|
||||
"k8s.io/client-go/tools/events"
|
||||
"k8s.io/klog/v2/ktesting"
|
||||
kubeschedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2"
|
||||
extenderv1 "k8s.io/kube-scheduler/extender/v1"
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
@@ -1337,7 +1338,8 @@ func TestSelectBestCandidate(t *testing.T) {
|
||||
cs := clientsetfake.NewSimpleClientset(objs...)
|
||||
informerFactory := informers.NewSharedInformerFactory(cs, 0)
|
||||
snapshot := internalcache.NewSnapshot(tt.pods, nodes)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
logger, ctx := ktesting.NewTestContext(t)
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
fwk, err := st.NewFramework(
|
||||
[]st.RegisterPluginFunc{
|
||||
@@ -1380,7 +1382,7 @@ func TestSelectBestCandidate(t *testing.T) {
|
||||
}
|
||||
offset, numCandidates := pl.GetOffsetAndNumCandidates(int32(len(nodeInfos)))
|
||||
candidates, _, _ := pe.DryRunPreemption(ctx, tt.pod, nodeInfos, nil, offset, numCandidates)
|
||||
s := pe.SelectCandidate(candidates)
|
||||
s := pe.SelectCandidate(logger, candidates)
|
||||
if s == nil || len(s.Name()) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user