Skip to content

Commit

Permalink
fix: Do not error on duplicate workflow creation by cron (#4871)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Behar <simbeh7@gmail.com>
  • Loading branch information
simster7 authored Jan 13, 2021
1 parent 239272a commit 955a4bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workflow/cron/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ func (woc *cronWfOperationCtx) run(ctx context.Context, scheduledRuntime time.Ti

runWf, err := util.SubmitWorkflow(ctx, woc.wfClient, woc.wfClientset, woc.cronWf.Namespace, wf, &v1alpha1.SubmitOpts{})
if err != nil {
// If the workflow already exists (i.e. this is a duplicate submission), do not report an error
if errors.IsAlreadyExists(err) {
return
}
woc.reportCronWorkflowError(v1alpha1.ConditionTypeSubmissionError, fmt.Sprintf("Failed to submit Workflow: %s", err))
return
}
Expand Down

0 comments on commit 955a4bb

Please sign in to comment.