Skip to content

Commit

Permalink
Merge pull request #729 from HumairAK/fix_delete_status_err
Browse files Browse the repository at this point in the history
prevent dspa status update on a terminating dspa
  • Loading branch information
HumairAK authored Oct 18, 2024
2 parents 24f564b + 54b2cee commit ef30372
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/dspipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func (r *DSPAReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.
if err := r.Update(ctx, dspa); err != nil {
return ctrl.Result{}, err
}
log.Info("DSPA resources cleaned up.")
}

// Stop reconciliation as the item is being deleted
Expand Down Expand Up @@ -363,6 +364,11 @@ func (r *DSPAReconciler) setStatus(ctx context.Context, resourceName string, con
func (r *DSPAReconciler) updateStatus(ctx context.Context, dspa *dspav1alpha1.DataSciencePipelinesApplication,
dspaStatus dspastatus.DSPAStatus, log logr.Logger, req ctrl.Request) {
r.refreshDspa(ctx, dspa, req, log)

// TODO: this is a workaround, handle deletion more gracefully
if dspa.DeletionTimestamp != nil {
return
}
dspa.Status.Components = r.GetComponents(ctx, dspa)
dspa.Status.Conditions = dspaStatus.GetConditions()
err := r.Status().Update(ctx, dspa)
Expand Down

0 comments on commit ef30372

Please sign in to comment.