Skip to content

Commit

Permalink
fix: don't fail workflow if PDB creation fails (#13102)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Clucas <alan@clucas.org>
  • Loading branch information
Joibel committed Jun 9, 2024
1 parent effcab7 commit cc604e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,16 @@ func (woc *wfOperationCtx) operate(ctx context.Context) {
}

if woc.wf.Status.Phase == wfv1.WorkflowUnknown {
woc.markWorkflowRunning(ctx)
setWfPodNamesAnnotation(woc.wf)

err := woc.createPDBResource(ctx)
if err != nil {
msg := fmt.Sprintf("Unable to create PDB resource for workflow, %s error: %s", woc.wf.Name, err)
woc.markWorkflowFailed(ctx, msg)
woc.log.WithError(err).WithField("workflow", woc.wf.Name).Error("PDB creation failed")
woc.requeue()
return
}

woc.markWorkflowRunning(ctx)
setWfPodNamesAnnotation(woc.wf)

woc.workflowDeadline = woc.getWorkflowDeadline()

// Workflow will not be requeued if workflow steps are in pending state.
Expand Down

0 comments on commit cc604e4

Please sign in to comment.