Skip to content

Commit

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

Signed-off-by: shuangkun <tsk2013uestc@163.com>
  • Loading branch information
shuangkun committed Apr 2, 2024
1 parent fb6c3d0 commit cd0c58e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions workflow/controller/operator.go
Expand Up @@ -747,6 +747,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 @@ -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 {
Expand Down

0 comments on commit cd0c58e

Please sign in to comment.