Skip to content

Commit ec71d7c

Browse files
committed
dont delete an already deleting vmss vm
1 parent f34ff17 commit ec71d7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

exp/controllers/azuremachinepoolmachine_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,12 @@ func (ampmr *AzureMachinePoolMachineController) reconcileDelete(ctx context.Cont
337337
return reconcile.Result{}, nil
338338
}
339339

340+
if machineScope.ProvisioningState() == infrav1.Deleting || machineScope.ProvisioningState() == infrav1.Deleted {
341+
log.V(2).Info(fmt.Sprintf("Skipping VMSS VM deletion as VMSS VM is already %s", machineScope.ProvisioningState()))
342+
controllerutil.RemoveFinalizer(machineScope.AzureMachinePoolMachine, infrav1exp.AzureMachinePoolMachineFinalizer)
343+
return reconcile.Result{}, nil
344+
}
345+
340346
log.Info("Deleting AzureMachinePoolMachine")
341347

342348
// deleting a single machine

0 commit comments

Comments
 (0)