Skip to content

Commit a03f5c2

Browse files
authored
Merge pull request #3338 from nojnhuh/aks-delete
add missing requeues for transient AKS delete errors
2 parents 5a4257d + dd8b62f commit a03f5c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

controllers/azuremanagedcontrolplane_controller.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ func (amcpr *AzureManagedControlPlaneReconciler) reconcileDelete(ctx context.Con
270270
log.Info("Reconciling AzureManagedControlPlane delete")
271271

272272
if err := newAzureManagedControlPlaneReconciler(scope).Delete(ctx); err != nil {
273+
// Handle transient errors
274+
var reconcileError azure.ReconcileError
275+
if errors.As(err, &reconcileError) && reconcileError.IsTransient() {
276+
if azure.IsOperationNotDoneError(reconcileError) {
277+
log.V(2).Info(fmt.Sprintf("AzureManagedControlPlane delete not done: %s", reconcileError.Error()))
278+
} else {
279+
log.V(2).Info("transient failure to delete AzureManagedControlPlane, retrying")
280+
}
281+
return reconcile.Result{RequeueAfter: reconcileError.RequeueAfter()}, nil
282+
}
273283
return reconcile.Result{}, errors.Wrapf(err, "error deleting AzureManagedControlPlane %s/%s", scope.ControlPlane.Namespace, scope.ControlPlane.Name)
274284
}
275285

0 commit comments

Comments
 (0)