Skip to content

Commit

Permalink
Use stored templates to raggregate step outputs (argoproj#1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki authored and sarabala1979 committed Oct 7, 2019
1 parent cd6f362 commit 7f385a6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions workflow/controller/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,18 @@ func (woc *wfOperationCtx) executeSteps(nodeName string, tmplCtx *templateresolu
childNodes = append(childNodes, node)
}
}
tmpl, err := stepsCtx.tmplCtx.GetTemplate(&step)
if err != nil {
return err
}
err = woc.processAggregateNodeOutputs(tmpl, stepsCtx.scope, prefix, childNodes)
if err != nil {
return err
if len(childNodes) > 0 {
// Expanded child nodes should be created from the same template.
tmpl := woc.wf.GetStoredTemplate(&childNodes[0])
if tmpl == nil {
return errors.InternalErrorf("Template of step node '%s' not found", childNode)
}
err := woc.processAggregateNodeOutputs(tmpl, stepsCtx.scope, prefix, childNodes)
if err != nil {
return err
}
} else {
woc.log.Infof("Step '%s' has no expanded child nodes", childNode)
}
} else {
woc.processNodeOutputs(stepsCtx.scope, prefix, childNode)
Expand Down

0 comments on commit 7f385a6

Please sign in to comment.