Fix returning ctrl.Result and error preventing backoff (#50)

This commit is contained in:
M. Essam
2025-07-10 10:52:48 +02:00
committed by GitHub
parent 0cf1dbafd4
commit 09249b6b62
4 changed files with 24 additions and 0 deletions
@@ -52,6 +52,12 @@ func (r *NBResourceReconciler) Reconcile(ctx context.Context, req ctrl.Request)
originalResource := nbResource.DeepCopy()
defer func() {
if err != nil {
// double check result is nil, otherwise error is not printed
// and exponential backoff doesn't work properly
res = ctrl.Result{}
return
}
if originalResource.DeletionTimestamp != nil && len(nbResource.Finalizers) == 0 {
return
}