mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-05-19 00:00:14 +08:00
Added unit tests to sample-controller
Added unit tests. Changed NewController function to accept informers and not informers factory. This make code more testable and align it with other controllers. Kubernetes-commit: a29a1cbb955e993300c9388a218a4f323f3fdf8f
This commit is contained in:
committed by
Kubernetes Publisher
parent
d934464330
commit
92fe46a498
@@ -61,7 +61,9 @@ func main() {
|
||||
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClient, time.Second*30)
|
||||
exampleInformerFactory := informers.NewSharedInformerFactory(exampleClient, time.Second*30)
|
||||
|
||||
controller := NewController(kubeClient, exampleClient, kubeInformerFactory, exampleInformerFactory)
|
||||
controller := NewController(kubeClient, exampleClient,
|
||||
kubeInformerFactory.Apps().V1().Deployments(),
|
||||
exampleInformerFactory.Samplecontroller().V1alpha1().Foos())
|
||||
|
||||
go kubeInformerFactory.Start(stopCh)
|
||||
go exampleInformerFactory.Start(stopCh)
|
||||
|
||||
Reference in New Issue
Block a user