Skip to content

Commit

Permalink
fix: Change scope node to taskNode at executeTmplLifeCycleHook
Browse files Browse the repository at this point in the history
Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>
  • Loading branch information
toyamagu-2021 committed Aug 26, 2023
1 parent bc6b77c commit 11c2144
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions workflow/controller/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func (woc *wfOperationCtx) executeDAG(ctx context.Context, nodeName string, tmpl
woc.markNodeError(node.Name, err)
return node, err
}
scope.addParamToScope(fmt.Sprintf("tasks.%s.status", task.Name), string(node.Phase))
scope.addParamToScope(fmt.Sprintf("tasks.%s.status", task.Name), string(taskNode.Phase))
_, err = woc.executeTmplLifeCycleHook(ctx, scope, dagCtx.GetTask(taskName).Hooks, taskNode, dagCtx.boundaryID, dagCtx.tmplCtx, "tasks."+taskName)
if err != nil {
woc.markNodeError(node.Name, err)
Expand Down Expand Up @@ -405,7 +405,6 @@ func (woc *wfOperationCtx) executeDAGTask(ctx context.Context, dagCtx *dagContex

node := dagCtx.getTaskNode(taskName)
task := dagCtx.GetTask(taskName)
log := woc.log.WithField("taskName", taskName)
if node != nil && (node.Fulfilled() || node.Phase == wfv1.NodeRunning) {
scope, err := woc.buildLocalScopeFromTask(dagCtx, task)
if err != nil {
Expand Down

0 comments on commit 11c2144

Please sign in to comment.