Skip to content

Commit 5792ac0

Browse files
committed
skips cluster module during vm reconcile when the disable cluster module is turned on
1 parent bee9ae4 commit 5792ac0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/vspherevm_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ func (r vmReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.R
314314
// This logic was moved to a smaller function outside the main Reconcile() loop
315315
// for the ease of testing.
316316
func (r vmReconciler) reconcile(ctx context.Context, vmCtx *capvcontext.VMContext, input fetchClusterModuleInput) (reconcile.Result, error) {
317-
if feature.Gates.Enabled(feature.NodeAntiAffinity) {
317+
if feature.Gates.Enabled(feature.NodeAntiAffinity) && !input.VSphereCluster.Spec.DisableClusterModule {
318318
clusterModuleInfo, err := r.fetchClusterModuleInfo(ctx, input)
319319
// If cluster module information cannot be fetched for a VM being deleted,
320320
// we should not block VM deletion since the cluster module is updated

0 commit comments

Comments
 (0)