Skip to content

Commit

Permalink
controller: ignore NotFound API error on delete
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco committed Nov 3, 2023
1 parent 7c5c23a commit c12b8c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/controller/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ func (r *HelmReleaseReconciler) Reconcile(ctx context.Context, req ctrl.Request)
}

if err := patchHelper.Patch(ctx, obj, patchOpts...); err != nil {
if retErr != nil {
retErr = apierrutil.NewAggregate([]error{retErr, err})
} else {
retErr = err
if !obj.DeletionTimestamp.IsZero() {
err = apierrutil.FilterOut(err, func(e error) bool { return apierrors.IsNotFound(e) })
}
retErr = apierrutil.Reduce(apierrutil.NewAggregate([]error{retErr, err}))
}

// Always record suspend, readiness and duration metrics.
Expand Down

0 comments on commit c12b8c8

Please sign in to comment.