Skip to content

Commit

Permalink
Do not throw error when not finding a reconciling IP (#341)
Browse files Browse the repository at this point in the history
Log and continue, it might be in deletion
  • Loading branch information
damyan authored Jun 11, 2024
1 parent b8c17af commit c482fcf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/ip_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ func (r *IPReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Re
ip := &v1alpha1.IP{}
err := r.Get(ctx, req.NamespacedName, ip)
if apierrors.IsNotFound(err) {
log.Error(err, "requested ip resource not found", "name", req.NamespacedName)
// object not found, it may have been deleted after the reconcile request.
log.Info("Resource not found, it might have been deleted.")
return ctrl.Result{}, client.IgnoreNotFound(err)
}
if err != nil {
Expand Down

0 comments on commit c482fcf

Please sign in to comment.