funcInitManager() { logf.SetLogger(zap.New()) mgr ,err:= manager.New(K8sRestConfig(),manager.Options{ Logger: logf.Log.WithName("dbcore"), }) if err != nil { mgr.GetLogger().Error(err,"could not create manager") os.Exit(1) } if err = v1.SchemeBuilder.AddToScheme(mgr.GetScheme());err!=nil { mgr.GetLogger().Error(err,"unable to schme") os.Exit(1) } dbConfigController:=controllers.NewDbConfigController() if err = builder.ControllerManagedBy(mgr). For(&v1.DbConfig{}). Watches(&source.Kind{Type: &appsv1.Deployment{}}, handler.Funcs{ DeleteFunc: dbConfigController.OnDelete, UpdateFunc: dbConfigController.OnUpdate},). Complete(controllers.NewDbConfigController());err!=nil{ mgr.GetLogger().Error(err,"unable to create manager") os.Exit(1) }
if err:=mgr.Add(dashboard.NewAdmiUi());err!=nil{ mgr.GetLogger().Error(err,"unable to create dashboard") os.Exit(1) } if err= mgr.Start(signals.SetupSignalHandler());err!= nil { mgr.GetLogger().Error(err,"unable to start manager") }