Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
calling abort rather than finalize on permanent failure (#449)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw authored Jun 6, 2022
1 parent b9fb6e3 commit ac293ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/nodes/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ func (c *nodeExecutor) handleNode(ctx context.Context, dag executors.DAGStructur

if currentPhase == v1alpha1.NodePhaseFailing {
logger.Debugf(ctx, "node failing")
if err := c.finalize(ctx, h, nCtx); err != nil {
if err := c.abort(ctx, h, nCtx, "node failing"); err != nil {
return executors.NodeStatusUndefined, err
}
nodeStatus.UpdatePhase(v1alpha1.NodePhaseFailed, v1.Now(), nodeStatus.GetMessage(), nodeStatus.GetExecutionError())
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/nodes/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ func TestNodeExecutor_RecursiveNodeHandler_Recurse(t *testing.T) {
} else {
h.OnFinalizeMatch(mock.Anything, mock.Anything).Return(nil)
}
h.OnAbortMatch(mock.Anything, mock.Anything, mock.Anything).Return(nil)
hf.OnGetHandler(v1alpha1.NodeKindTask).Return(h, nil)

mockWf, _, mockNodeStatus := createSingleNodeWf(test.currentNodePhase, 0)
Expand Down

0 comments on commit ac293ed

Please sign in to comment.