add gc and improve testing

This commit is contained in:
Jefftree
2024-07-23 02:57:34 +00:00
parent c47ff1e1a9
commit e0c6987ca8
7 changed files with 606 additions and 53 deletions

View File

@@ -162,7 +162,15 @@ func (c completedConfig) New(name string, delegationTarget genericapiserver.Dele
client.CoordinationV1(),
client.CoordinationV1alpha1(),
)
return controller.Run, err
gccontroller := leaderelection.NewLeaseCandidateGC(
client,
1*time.Hour,
lcInformer,
)
return func(ctx context.Context, workers int) {
go controller.Run(ctx, workers)
go gccontroller.Run(ctx.Done())
}, err
})
return nil
})