@@ -67,6 +67,8 @@ func main() {
6767 var secureMetrics bool
6868 var enableHTTP2 bool
6969 var tlsOpts []func (* tls.Config )
70+ var configFile string
71+ flag .StringVar (& configFile , "config" , "/etc/tensor-fusion/config.yaml" , "Config file of tensor-fusion-operator" )
7072 flag .StringVar (& metricsAddr , "metrics-bind-address" , "0" , "The address the metrics endpoint binds to. " +
7173 "Use :8443 for HTTPS or :8080 for HTTP, or leave as 0 to disable the metrics service." )
7274 flag .StringVar (& probeAddr , "health-probe-bind-address" , ":8081" , "The address the probe endpoint binds to." )
@@ -152,7 +154,13 @@ func main() {
152154 }
153155
154156 ctx := context .Background ()
155- config := config .NewDefaultConfig ()
157+ config , err := config .LoadConfig (configFile )
158+ if os .IsNotExist (err ) {
159+ setupLog .Info ("config file is not exists, use default config" , "configFile" , configFile )
160+ } else if err != nil {
161+ setupLog .Error (err , "unable to load config" , "configFile" , configFile , "err" , err )
162+ os .Exit (1 )
163+ }
156164 scheduler := scheduler .NewNaiveScheduler ()
157165 if err = (& controller.TensorFusionConnectionReconciler {
158166 Client : mgr .GetClient (),
@@ -183,6 +191,7 @@ func main() {
183191 }
184192 }
185193
194+
186195 if err = (& controller.TensorFusionClusterReconciler {
187196 Client : mgr .GetClient (),
188197 Scheme : mgr .GetScheme (),
@@ -211,6 +220,13 @@ func main() {
211220 setupLog .Error (err , "unable to create controller" , "controller" , "GPUNodeClass" )
212221 os .Exit (1 )
213222 }
223+ if err = (& controller.PodReconciler {
224+ Client : mgr .GetClient (),
225+ Scheme : mgr .GetScheme (),
226+ }).SetupWithManager (mgr ); err != nil {
227+ setupLog .Error (err , "unable to create controller" , "controller" , "Pod" )
228+ os .Exit (1 )
229+ }
214230 // +kubebuilder:scaffold:builder
215231 if err := mgr .AddHealthzCheck ("healthz" , healthz .Ping ); err != nil {
216232 setupLog .Error (err , "unable to set up health check" )
0 commit comments