Pass Context to StartTestServer

Signed-off-by: Kante Yin <kerthcet@gmail.com>
This commit is contained in:
Kante Yin
2023-03-31 12:19:26 +08:00
committed by kerthcet
parent 2d866ec2fc
commit a7035f5459
42 changed files with 754 additions and 473 deletions

View File

@@ -291,8 +291,12 @@ func TestCustomResourceEnqueue(t *testing.T) {
testfwk.SharedEtcd(),
)
testCtx := &testutils.TestContext{}
testCtx.Ctx, testCtx.CancelFn = context.WithCancel(context.Background())
testCtx.CloseFn = func() { server.TearDownFn() }
ctx, cancel := context.WithCancel(context.Background())
testCtx.Ctx = ctx
testCtx.CloseFn = func() {
cancel()
server.TearDownFn()
}
apiExtensionClient := apiextensionsclient.NewForConfigOrDie(server.ClientConfig)
dynamicClient := dynamic.NewForConfigOrDie(server.ClientConfig)