Clean shutdown of test apiserver

This commit is contained in:
Wojciech Tyczyński
2022-05-12 12:10:02 +02:00
parent e0dbea2443
commit 6f706775bc
10 changed files with 111 additions and 67 deletions

View File

@@ -37,14 +37,11 @@ import (
)
func TestWebhookLoopback(t *testing.T) {
stopCh := make(chan struct{})
defer close(stopCh)
webhookPath := "/webhook-test"
called := int32(0)
client, _ := framework.StartTestServer(t, stopCh, framework.TestServerSetup{
client, _, tearDownFn := framework.StartTestServer(t, framework.TestServerSetup{
ModifyServerRunOptions: func(opts *options.ServerRunOptions) {
},
ModifyServerConfig: func(config *controlplane.Config) {
@@ -66,6 +63,7 @@ func TestWebhookLoopback(t *testing.T) {
})
},
})
defer tearDownFn()
fail := admissionregistrationv1.Fail
noSideEffects := admissionregistrationv1.SideEffectClassNone