@@ -19,6 +19,7 @@ import (
1919 "k8s.io/klog/v2"
2020 crsv1 "sigs.k8s.io/cluster-api/api/addons/v1beta1"
2121 clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+ controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1"
2223 ctrl "sigs.k8s.io/controller-runtime"
2324 "sigs.k8s.io/controller-runtime/pkg/client"
2425 "sigs.k8s.io/controller-runtime/pkg/controller"
@@ -32,6 +33,7 @@ import (
3233 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/handlers"
3334 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/server"
3435 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/controllers/enforceclusterautoscalerlimits"
36+ "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/controllers/failuredomainrollout"
3537 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/controllers/namespacesync"
3638 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/feature"
3739 "github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/pkg/handlers/aws"
@@ -55,6 +57,7 @@ func main() {
5557 utilruntime .Must (clientgoscheme .AddToScheme (clientScheme ))
5658 utilruntime .Must (crsv1 .AddToScheme (clientScheme ))
5759 utilruntime .Must (clusterv1 .AddToScheme (clientScheme ))
60+ utilruntime .Must (controlplanev1 .AddToScheme (clientScheme ))
5861 utilruntime .Must (caaphv1 .AddToScheme (clientScheme ))
5962
6063 webhookOptions := webhook.Options {
@@ -121,6 +124,7 @@ func main() {
121124
122125 namespacesyncOptions := namespacesync.Options {}
123126 enforceClusterAutoscalerLimitsOptions := enforceclusterautoscalerlimits.Options {}
127+ failureDomainRolloutOptions := failuredomainrollout.Options {}
124128
125129 // Initialize and parse command line flags.
126130 logs .AddFlags (pflag .CommandLine , logs .SkipLoggingConfigurationFlags ())
@@ -133,6 +137,7 @@ func main() {
133137 nutanixMetaHandlers .AddFlags (pflag .CommandLine )
134138 namespacesyncOptions .AddFlags (pflag .CommandLine )
135139 enforceClusterAutoscalerLimitsOptions .AddFlags (pflag .CommandLine )
140+ failureDomainRolloutOptions .AddFlags (pflag .CommandLine )
136141 pflag .CommandLine .SetNormalizeFunc (cliflag .WordSepNormalizeFunc )
137142 pflag .CommandLine .AddGoFlagSet (flag .CommandLine )
138143
@@ -232,6 +237,23 @@ func main() {
232237 }
233238 }
234239
240+ if failureDomainRolloutOptions .Enabled {
241+ if err := (& failuredomainrollout.Reconciler {
242+ Client : mgr .GetClient (),
243+ }).SetupWithManager (
244+ mgr ,
245+ & controller.Options {MaxConcurrentReconciles : failureDomainRolloutOptions .Concurrency },
246+ ); err != nil {
247+ setupLog .Error (
248+ err ,
249+ "unable to create controller" ,
250+ "controller" ,
251+ "failuredomainrollout.Reconciler" ,
252+ )
253+ os .Exit (1 )
254+ }
255+ }
256+
235257 mgr .GetWebhookServer ().Register ("/mutate-v1beta1-cluster" , & webhook.Admission {
236258 Handler : cluster .NewDefaulter (mgr .GetClient (), admission .NewDecoder (mgr .GetScheme ())),
237259 })
0 commit comments