@@ -20,9 +20,6 @@ import (
2020	"flag" 
2121	"os" 
2222
23- 	// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.) 
24- 	// to ensure that exec-entrypoint and run can make use of them. 
25- 
2623	_ "k8s.io/client-go/plugin/pkg/client/auth" 
2724
2825	"k8s.io/apimachinery/pkg/runtime" 
@@ -106,7 +103,6 @@ func main() {
106103	// will block until the cert is ready before setting up the controllers. 
107104	// Controllers who register after manager starts will start directly. 
108105	go  setupControllers (mgr , certsReady )
109- 
110106	//+kubebuilder:scaffold:builder 
111107
112108	if  err  :=  mgr .AddHealthzCheck ("healthz" , healthz .Ping ); err  !=  nil  {
@@ -161,6 +157,13 @@ func setupControllers(mgr ctrl.Manager, certsReady chan struct{}) {
161157		setupLog .Error (err , "unable to create controller" , "controller" , "Torrent" )
162158		os .Exit (1 )
163159	}
160+ 	if  err  :=  controller .NewPodReconciler (
161+ 		mgr .GetClient (),
162+ 		mgr .GetScheme (),
163+ 	).SetupWithManager (mgr ); err  !=  nil  {
164+ 		setupLog .Error (err , "unable to create controller" , "controller" , "Pod" )
165+ 		os .Exit (1 )
166+ 	}
164167
165168	if  os .Getenv ("ENABLE_WEBHOOKS" ) !=  "false"  {
166169		if  err  :=  webhook .SetupTorrentWebhook (mgr ); err  !=  nil  {
@@ -171,5 +174,9 @@ func setupControllers(mgr ctrl.Manager, certsReady chan struct{}) {
171174			setupLog .Error (err , "unable to create webhook" , "webhook" , "Replication" )
172175			os .Exit (1 )
173176		}
177+ 		if  err  :=  webhook .SetupPodWebhook (mgr ); err  !=  nil  {
178+ 			setupLog .Error (err , "unable to create webhook" , "webhook" , "Pod" )
179+ 			os .Exit (1 )
180+ 		}
174181	}
175182}
0 commit comments