Skip to content

Commit

Permalink
fix: remove completed taskset status before update workflow. Fixes: #…
Browse files Browse the repository at this point in the history
…12832 (#12835)

Signed-off-by: shuangkun <[email protected]>
(cherry picked from commit cd0c58e)
  • Loading branch information
shuangkun authored and Anton Gilgur committed Apr 19, 2024
1 parent ce7cad3 commit 8c9a857
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,12 @@ func (woc *wfOperationCtx) persistUpdates(ctx context.Context) {
}
}

// Remove completed taskset status before update workflow.
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))
Expand Down Expand Up @@ -792,12 +798,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 {
Expand Down

0 comments on commit 8c9a857

Please sign in to comment.