Skip to content

Commit fe12ad9

Browse files
Merge pull request opendatahub-io#119 from gmfrasca/bugfix-reconcile-error
Bugfix: Benign modified DSPA object error
2 parents 1902227 + e007a81 commit fe12ad9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

controllers/dspipeline_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
276276
}
277277

278278
log.Info("Updating CR status")
279+
// Refresh DSPA before updating
280+
err = r.Get(ctx, req.NamespacedName, dspa)
281+
if err != nil {
282+
log.Info(err.Error())
283+
return ctrl.Result{}, err
284+
}
279285

280286
crReady := r.buildCondition(config.CrReady, dspa, config.MinimumReplicasAvailable)
281287
crReady.Type = config.CrReady
@@ -297,6 +303,7 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
297303
}
298304
dspa.Status.Conditions = conditions
299305

306+
// Update Status
300307
err = r.Status().Update(ctx, dspa)
301308
if err != nil {
302309
log.Info(err.Error())

0 commit comments

Comments
 (0)