Skip to content

Commit fe8a539

Browse files
Merge pull request opendatahub-io#223 from amadhusu/am/172
Added RequeueAfter to ensure periodic reconciliation
2 parents 0a379a6 + 304d4e3 commit fe8a539

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

controllers/dspipeline_controller.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package controllers
1919
import (
2020
"context"
2121
"fmt"
22+
"time"
2223

2324
"github.com/go-logr/logr"
2425
mf "github.com/manifestival/manifestival"
@@ -161,10 +162,10 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
161162
dspa := &dspav1alpha1.DataSciencePipelinesApplication{}
162163
err := r.Get(ctx, req.NamespacedName, dspa)
163164
if err != nil && apierrs.IsNotFound(err) {
164-
log.Info("Stop DSPAParams reconciliation")
165+
log.Info("DSPA resource was not found")
165166
return ctrl.Result{}, nil
166167
} else if err != nil {
167-
log.Error(err, "Unable to fetch the DSPAParams")
168+
log.Error(err, "Encountered error when fetching DSPA")
168169
return ctrl.Result{}, err
169170
}
170171

@@ -205,7 +206,7 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
205206
err = params.ExtractParams(ctx, dspa, r.Client, r.Log)
206207
if err != nil {
207208
log.Info(fmt.Sprintf("Encountered error when parsing CR: [%s]", err))
208-
return ctrl.Result{}, nil
209+
return ctrl.Result{Requeue: true, RequeueAfter: 2 * time.Minute}, nil
209210
}
210211

211212
err = r.ReconcileDatabase(ctx, dspa, params)

0 commit comments

Comments
 (0)