@@ -140,11 +140,12 @@ 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+ patch := client .MergeFrom (claim .DeepCopy ())
143144 if err := r .reconcileDelete (ctx , claim ); err != nil {
144145 return ctrl.Result {}, fmt .Errorf ("reconcile delete: %w" , err )
145146 }
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 {
147+ // we'll need to explicitly patch the claim here since we haven't set up a patch helper yet.
148+ if err := r .Client .Patch (ctx , claim , patch ); err != nil {
148149 return ctrl.Result {}, fmt .Errorf ("patch after reconciling delete: %w" , err )
149150 }
150151 return ctrl.Result {}, nil
@@ -272,8 +273,9 @@ func (r *ClaimReconciler) reconcileDelete(ctx context.Context, claim *ipamv1.IPA
272273
273274 if address .Name != "" {
274275 var err error
276+ patch := client .MergeFrom (address .DeepCopy ())
275277 if controllerutil .RemoveFinalizer (address , ProtectAddressFinalizer ) {
276- if err = r .Client .Update (ctx , address ); err != nil && ! apierrors .IsNotFound (err ) {
278+ if err = r .Client .Patch (ctx , address , patch ); err != nil && ! apierrors .IsNotFound (err ) {
277279 return errors .Wrap (err , "failed to remove address finalizer" )
278280 }
279281 }
0 commit comments