Skip to content

Commit ff393d5

Browse files
committed
fix skipping reconciliation, when a referenced cluster is already deleted
1 parent 56dca4e commit ff393d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/ipamutil/reconciler.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,14 @@ func (r *ClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ct
140140
if err != nil {
141141
if apierrors.IsNotFound(err) {
142142
if !claim.ObjectMeta.DeletionTimestamp.IsZero() {
143-
return ctrl.Result{}, r.reconcileDelete(ctx, claim)
143+
if err := r.reconcileDelete(ctx, claim); err != nil {
144+
return ctrl.Result{}, fmt.Errorf("reconcile delete: %w", err)
145+
}
146+
// we'll need to explicitly update the claim here since we haven't set up a patch helper yet.
147+
if err := r.Client.Update(ctx, claim); err != nil {
148+
return ctrl.Result{}, fmt.Errorf("patch after reconciling delete: %w", err)
149+
}
150+
return ctrl.Result{}, nil
144151
}
145152
log.Info("IPAddressClaim linked to a cluster that is not found, unable to determine cluster's paused state, skipping reconciliation")
146153
return ctrl.Result{}, nil

0 commit comments

Comments
 (0)