From f1839e665a14dd8ce8e19b786d7717f58cc2780f Mon Sep 17 00:00:00 2001 From: Antonin Stefanutti Date: Fri, 13 Dec 2024 16:24:29 +0100 Subject: [PATCH] Always update TrainJob status on errors Signed-off-by: Antonin Stefanutti --- pkg/controller.v2/trainjob_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller.v2/trainjob_controller.go b/pkg/controller.v2/trainjob_controller.go index 81a49c1889..ad5fde4c8a 100644 --- a/pkg/controller.v2/trainjob_controller.go +++ b/pkg/controller.v2/trainjob_controller.go @@ -94,7 +94,7 @@ func (r *TrainJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c setSuspendedCondition(&trainJob) setCreatedCondition(&trainJob, opState) if terminalCondErr := setTerminalCondition(ctx, runtime, &trainJob); terminalCondErr != nil { - return ctrl.Result{}, errors.Join(err, terminalCondErr) + err = errors.Join(err, terminalCondErr) } if !equality.Semantic.DeepEqual(&trainJob.Status, originStatus) { return ctrl.Result{}, errors.Join(err, r.client.Status().Update(ctx, &trainJob))