From a00697cb3d575b9cb4b71bd501067bc3869d8862 Mon Sep 17 00:00:00 2001 From: shuangkun Date: Fri, 22 Mar 2024 17:33:56 +0800 Subject: [PATCH] fix: Remove completed taskset status before mark worklfow complete. #12823 Signed-off-by: shuangkun --- workflow/controller/operator.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index 9a830aed186b..fe4d2c37879e 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -747,6 +747,12 @@ func (woc *wfOperationCtx) persistUpdates(ctx context.Context) { } } + // Remove completed taskset status before mark worklfow completed. + err = woc.removeCompletedTaskSetStatus(ctx) + if err != nil { + woc.log.WithError(err).Warn("error updating taskset") + } + wf, err := wfClient.Update(ctx, woc.wf, metav1.UpdateOptions{}) if err != nil { woc.log.Warnf("Error updating workflow: %v %s", err, apierr.ReasonForError(err)) @@ -794,12 +800,6 @@ func (woc *wfOperationCtx) persistUpdates(ctx context.Context) { time.Sleep(1 * time.Second) } - err = woc.removeCompletedTaskSetStatus(ctx) - - if err != nil { - woc.log.WithError(err).Warn("error updating taskset") - } - // Make sure the workflow completed. if woc.wf.Status.Fulfilled() { if err := woc.deleteTaskResults(ctx); err != nil {