Skip to content

Commit

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

Signed-off-by: shuangkun <[email protected]>
  • Loading branch information
shuangkun authored and isubasinghe committed May 7, 2024
1 parent 774388a commit c5b4935
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 @@ -346,6 +346,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 @@ -779,6 +779,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 c5b4935

Please sign in to comment.