Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #400 from stuggi/fix_RequeueAfter
Browse files Browse the repository at this point in the history
Return nil error in case NotFound and to use RequeueAfter
  • Loading branch information
openshift-merge-bot[bot] authored Aug 7, 2024
2 parents 135e3b0 + 29c1a5c commit bc765ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/openstack_ansibleee_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,14 @@ func (r *OpenStackAnsibleEEReconciler) Reconcile(ctx context.Context, req ctrl.R
_, err := nad.GetNADWithName(ctx, helper, netAtt, instance.Namespace)
if err != nil {
if errors.IsNotFound(err) {
Log.Info(fmt.Sprintf("network-attachment-definition %s not found", netAtt))
instance.Status.Conditions.Set(condition.FalseCondition(
condition.NetworkAttachmentsReadyCondition,
condition.RequestedReason,
condition.SeverityInfo,
condition.NetworkAttachmentsReadyWaitingMessage,
netAtt))
return ctrl.Result{RequeueAfter: time.Second * 10}, fmt.Errorf("network-attachment-definition %s not found", netAtt)
return ctrl.Result{RequeueAfter: time.Second * 10}, nil
}
instance.Status.Conditions.Set(condition.FalseCondition(
condition.NetworkAttachmentsReadyCondition,
Expand Down

0 comments on commit bc765ea

Please sign in to comment.