@@ -77,28 +77,29 @@ var (
7777 setupLog = ctrl .Log .WithName ("setup" )
7878
7979 // flags.
80- managerOptions = flags.ManagerOptions {}
81- enableLeaderElection bool
82- leaderElectionLeaseDuration time.Duration
83- leaderElectionRenewDeadline time.Duration
84- leaderElectionRetryPeriod time.Duration
85- watchNamespace string
86- watchFilterValue string
87- profilerAddress string
88- openStackClusterConcurrency int
89- openStackMachineConcurrency int
90- syncPeriod time.Duration
91- restConfigQPS float32
92- restConfigBurst int
93- webhookPort int
94- webhookCertDir string
95- healthAddr string
96- lbProvider string
97- caCertsPath string
98- showVersion bool
99- scopeCacheMaxSize int
100- skipCRDMigrationPhases []string
101- logOptions = logs .NewOptions ()
80+ managerOptions = flags.ManagerOptions {}
81+ enableLeaderElection bool
82+ leaderElectionLeaseDuration time.Duration
83+ leaderElectionRenewDeadline time.Duration
84+ leaderElectionRetryPeriod time.Duration
85+ watchNamespace string
86+ watchFilterValue string
87+ profilerAddress string
88+ openStackClusterConcurrency int
89+ openStackMachineConcurrency int
90+ openStackMachineTemplateConcurrency int
91+ syncPeriod time.Duration
92+ restConfigQPS float32
93+ restConfigBurst int
94+ webhookPort int
95+ webhookCertDir string
96+ healthAddr string
97+ lbProvider string
98+ caCertsPath string
99+ showVersion bool
100+ scopeCacheMaxSize int
101+ skipCRDMigrationPhases []string
102+ logOptions = logs .NewOptions ()
102103)
103104
104105func init () {
@@ -148,6 +149,9 @@ func InitFlags(fs *pflag.FlagSet) {
148149 fs .IntVar (& openStackMachineConcurrency , "openstackmachine-concurrency" , 10 ,
149150 "Number of OpenStackMachines to process simultaneously" )
150151
152+ fs .IntVar (& openStackMachineTemplateConcurrency , "openstackmachinetemplate-concurrency" , 10 ,
153+ "Number of OpenStackMachineTemplates to process simultaneously" )
154+
151155 fs .DurationVar (& syncPeriod , "sync-period" , 10 * time .Minute ,
152156 "The minimum interval at which watched resources are reconciled (e.g. 15m)" )
153157
@@ -395,6 +399,20 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager, caCerts []byte) {
395399 setupLog .Error (err , "unable to create controller" , "controller" , "OpenStackServer" )
396400 os .Exit (1 )
397401 }
402+
403+ if feature .Gates .Enabled (feature .AutoScaleFromZero ) {
404+ if err := (& controllers.OpenStackMachineTemplateReconciler {
405+ Client : mgr .GetClient (),
406+ Recorder : mgr .GetEventRecorderFor ("openstackmachinetemplate-controller" ),
407+ WatchFilterValue : watchFilterValue ,
408+ ScopeFactory : scopeFactory ,
409+ CaCertificates : caCerts ,
410+ }).SetupWithManager (ctx , mgr , concurrency (openStackMachineTemplateConcurrency )); err != nil {
411+ setupLog .Error (err , "unable to create controller" , "controller" , "OpenStackMachineTemplate" )
412+ os .Exit (1 )
413+ }
414+ }
415+
398416}
399417
400418func setupWebhooks (mgr ctrl.Manager ) {
0 commit comments