minimum runnable
This commit is contained in:
@@ -58,23 +58,23 @@ func main() {
|
||||
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||
}
|
||||
|
||||
exampleClient, err := clientset.NewForConfig(cfg)
|
||||
operatorClient, err := clientset.NewForConfig(cfg)
|
||||
if err != nil {
|
||||
logger.Error(err, "Error building kubernetes clientset")
|
||||
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||
}
|
||||
|
||||
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClient, time.Second*30)
|
||||
exampleInformerFactory := informers.NewSharedInformerFactory(exampleClient, time.Second*30)
|
||||
operatorInformerFactory := informers.NewSharedInformerFactory(operatorClient, time.Second*30)
|
||||
|
||||
controller := NewController(ctx, kubeClient, exampleClient,
|
||||
controller := NewController(ctx, kubeClient, operatorClient,
|
||||
kubeInformerFactory.Apps().V1().Deployments(),
|
||||
exampleInformerFactory.Samplecontroller().V1alpha1().Foos())
|
||||
operatorInformerFactory.Proxyprovider().V1().ProxyProviders())
|
||||
|
||||
// notice that there is no need to run Start methods in a separate goroutine. (i.e. go kubeInformerFactory.Start(ctx.done())
|
||||
// Start method is non-blocking and runs all registered informers in a dedicated goroutine.
|
||||
kubeInformerFactory.Start(ctx.Done())
|
||||
exampleInformerFactory.Start(ctx.Done())
|
||||
operatorInformerFactory.Start(ctx.Done())
|
||||
|
||||
if err = controller.Run(ctx, 2); err != nil {
|
||||
logger.Error(err, "Error running controller")
|
||||
|
||||
Reference in New Issue
Block a user