Skip to content

Commit

Permalink
fix: suppress error about unable to obtain node (#12020)
Browse files Browse the repository at this point in the history
Signed-off-by: mikutas <23391543+mikutas@users.noreply.github.com>
  • Loading branch information
mikutas authored and terrytangyuan committed Oct 19, 2023
1 parent ee939bb commit 61f00ba
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3638,25 +3638,28 @@ func (woc *wfOperationCtx) deletePDBResource(ctx context.Context) error {
// Check if the output of this node is referenced elsewhere in the Workflow. If so, make sure to include it during
// execution.
func (woc *wfOperationCtx) includeScriptOutput(nodeName, boundaryID string) (bool, error) {
if boundaryNode, err := woc.wf.Status.Nodes.Get(boundaryID); err == nil {
tmplCtx, err := woc.createTemplateContext(boundaryNode.GetTemplateScope())
if err != nil {
return false, err
}
_, parentTemplate, templateStored, err := tmplCtx.ResolveTemplate(boundaryNode)
if err != nil {
return false, err
}
// A new template was stored during resolution, persist it
if templateStored {
woc.updated = true
}
if boundaryID != "" {
if boundaryNode, err := woc.wf.Status.Nodes.Get(boundaryID); err == nil {
tmplCtx, err := woc.createTemplateContext(boundaryNode.GetTemplateScope())
if err != nil {
return false, err
}
_, parentTemplate, templateStored, err := tmplCtx.ResolveTemplate(boundaryNode)
if err != nil {
return false, err
}
// A new template was stored during resolution, persist it
if templateStored {
woc.updated = true
}

name := getStepOrDAGTaskName(nodeName)
return hasOutputResultRef(name, parentTemplate), nil
} else {
woc.log.Errorf("was unable to obtain node for %s", boundaryID)
name := getStepOrDAGTaskName(nodeName)
return hasOutputResultRef(name, parentTemplate), nil
} else {
woc.log.Errorf("was unable to obtain node for %s", boundaryID)
}
}

return false, nil
}

Expand Down

0 comments on commit 61f00ba

Please sign in to comment.