Skip to content

Commit 1150e3d

Browse files
committed
Move ASO secret controller behind feature gate
This commit moves the ASO secret controller setup behind the ASOAPI feature gate. In a self-managed CAPZ infra setup, with ASOAPI not enabled, the CAPZ pod will crash loop constantly due to this controller trying to find the AzureManagedControlPlane CR which is behind the ASOAPI feature gate. Signed-off-by: Bryan Cox <[email protected]>
1 parent df608bd commit 1150e3d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

main.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -429,17 +429,6 @@ func registerControllers(ctx context.Context, mgr manager.Manager) {
429429
os.Exit(1)
430430
}
431431

432-
if err := (&controllers.ASOSecretReconciler{
433-
Client: mgr.GetClient(),
434-
Recorder: mgr.GetEventRecorderFor("asosecret-reconciler"),
435-
Timeouts: timeouts,
436-
WatchFilterValue: watchFilterValue,
437-
CredentialCache: credCache,
438-
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: azureClusterConcurrency}); err != nil {
439-
setupLog.Error(err, "unable to create controller", "controller", "ASOSecret")
440-
os.Exit(1)
441-
}
442-
443432
// just use CAPI MachinePool feature flag rather than create a new one
444433
setupLog.V(1).Info(fmt.Sprintf("%+v\n", feature.Gates))
445434
if feature.Gates.Enabled(capifeature.MachinePool) {
@@ -535,6 +524,17 @@ func registerControllers(ctx context.Context, mgr manager.Manager) {
535524
}
536525

537526
if feature.Gates.Enabled(feature.ASOAPI) {
527+
if err := (&controllers.ASOSecretReconciler{
528+
Client: mgr.GetClient(),
529+
Recorder: mgr.GetEventRecorderFor("asosecret-reconciler"),
530+
Timeouts: timeouts,
531+
WatchFilterValue: watchFilterValue,
532+
CredentialCache: credCache,
533+
}).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: azureClusterConcurrency}); err != nil {
534+
setupLog.Error(err, "unable to create controller", "controller", "ASOSecret")
535+
os.Exit(1)
536+
}
537+
538538
if err := (&controllers.AzureASOManagedClusterReconciler{
539539
Client: mgr.GetClient(),
540540
WatchFilterValue: watchFilterValue,

0 commit comments

Comments
 (0)