Skip to content

Commit

Permalink
fix: Fix the TestStopBehavior flackiness (#8096)
Browse files Browse the repository at this point in the history
Signed-off-by: Saravanan Balasubramanian <sarabala1979@gmail.com>
  • Loading branch information
sarabala1979 committed Mar 18, 2022
1 parent 0cec273 commit 049d3d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/apis/workflow/v1alpha1/workflow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,11 @@ func (n NodeStatus) IsDaemoned() bool {
return true
}

// IsExitNode returns whether or not node run as exit handler.
func (ws NodeStatus) IsExitNode() bool {
return strings.HasSuffix(ws.DisplayName, ".onExit")
}

func (n NodeStatus) Succeeded() bool {
return n.Phase == NodeSucceeded
}
Expand Down
2 changes: 1 addition & 1 deletion workflow/controller/exec_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (woc *wfOperationCtx) handleExecutionControlError(nodeID string, wfNodesLoc
// then need to fail child nodes so they will not hang in Pending after pod deletion
for _, nodeID := range node.Children {
child := woc.wf.Status.Nodes[nodeID]
if !child.Fulfilled() {
if !child.IsExitNode() && !child.Fulfilled() {
woc.markNodePhase(child.Name, wfv1.NodeFailed, errorMsg)
}
}
Expand Down

0 comments on commit 049d3d1

Please sign in to comment.