migrated pkg/controller/endpointslice to contextual logging

Signed-off-by: Naman <namanlakhwani@gmail.com>
This commit is contained in:
Naman
2023-01-24 19:09:00 +05:30
parent c95b16b280
commit 09849b09cf
15 changed files with 186 additions and 132 deletions

View File

@@ -47,6 +47,7 @@ func TestEndpointSliceMirroring(t *testing.T) {
t.Fatalf("Error creating clientset: %v", err)
}
ctx, cancel := context.WithCancel(context.Background())
resyncPeriod := 12 * time.Hour
informers := informers.NewSharedInformerFactory(client, resyncPeriod)
@@ -58,6 +59,7 @@ func TestEndpointSliceMirroring(t *testing.T) {
1*time.Second)
epsController := endpointslice.NewController(
ctx,
informers.Core().V1().Pods(),
informers.Core().V1().Services(),
informers.Core().V1().Nodes(),
@@ -75,11 +77,10 @@ func TestEndpointSliceMirroring(t *testing.T) {
1*time.Second)
// Start informer and controllers
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
informers.Start(ctx.Done())
go epController.Run(ctx, 5)
go epsController.Run(5, ctx.Done())
go epsController.Run(ctx, 5)
go epsmController.Run(5, ctx.Done())
testCases := []struct {