Skip to content

Commit

Permalink
fix: make sure Finalizers has chance to be removed. Fixes: #12836 (#1…
Browse files Browse the repository at this point in the history
…2831)

Signed-off-by: shuangkun <tsk2013uestc@163.com>
  • Loading branch information
shuangkun authored Apr 2, 2024
1 parent d8acad7 commit fb6c3d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/e2e/fixtures/when.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ func (w *When) WaitForWorkflowList(listOptions metav1.ListOptions, condition fun
return w
}
}
time.Sleep(time.Second)
}
}

Expand Down
4 changes: 4 additions & 0 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ func (woc *wfOperationCtx) persistUpdates(ctx context.Context) {
woc.log.WithError(err).Warn("failed to delete task-results")
}
}
// If Finalizer exists, requeue to make sure Finalizer can be removed.
if woc.wf.Status.Fulfilled() && len(wf.GetFinalizers()) > 0 {
woc.requeueAfter(5 * time.Second)
}

// It is important that we *never* label pods as completed until we successfully updated the workflow
// Failing to do so means we can have inconsistent state.
Expand Down

0 comments on commit fb6c3d0

Please sign in to comment.