Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: shuangkun <tsk2013uestc@163.com>
  • Loading branch information
shuangkun committed Jan 14, 2024
1 parent f8470c8 commit 6e16be0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion workflow/controller/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,23 @@ func (woc *wfOperationCtx) resolveReferences(stepGroup []wfv1.WorkflowStep, scop
}(i, step)
}
wg.Wait()
if err = <-errCh; err != nil { // fetch the first error during resolveStepReferences

err = errorFromChannel(errCh)
if err != nil { // fetch the first error during resolveStepReferences
return nil, fmt.Errorf("Failed to resolve references: %s", err)
}
return newStepGroup, nil
}

func errorFromChannel(errCh <-chan error) error {
select {
case err := <-errCh:
return err
default:
}
return nil
}

// expandStepGroup looks at each step in a collection of parallel steps, and expands all steps using withItems/withParam
func (woc *wfOperationCtx) expandStepGroup(sgNodeName string, stepGroup []wfv1.WorkflowStep, stepsCtx *stepsContext) ([]wfv1.WorkflowStep, error) {
newStepGroup := make([]wfv1.WorkflowStep, 0)
Expand Down

0 comments on commit 6e16be0

Please sign in to comment.