Migrated the volumezone scheduler plugin to use contextual logging

This commit is contained in:
Mengjiao Liu
2023-03-22 11:09:31 +08:00
parent 9c6414cdfe
commit 27f84b755e
2 changed files with 11 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ import (
storagev1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2/ktesting"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/framework"
fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/fake"
@@ -232,7 +233,8 @@ func TestSingleZone(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
_, ctx := ktesting.NewTestContext(t)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
state := framework.NewCycleState()
@@ -363,7 +365,8 @@ func TestMultiZone(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
_, ctx := ktesting.NewTestContext(t)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
state := framework.NewCycleState()
@@ -487,7 +490,8 @@ func TestWithBinding(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
_, ctx := ktesting.NewTestContext(t)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
state := framework.NewCycleState()