Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore retry node when check succeeded descendant nodes. Fixes: #13003 #13004

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/e2e/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ func (s *CLISuite) TestRetryWorkflowWithContinueOn() {
Then().
ExpectWorkflow(func(t *testing.T, metadata *metav1.ObjectMeta, status *wfv1.WorkflowStatus) {
workflowName = metadata.Name
assert.Equal(t, 6, len(status.Nodes))
assert.Equal(t, 7, len(status.Nodes))
}).
RunCli([]string{"retry", workflowName}, func(t *testing.T, output string, err error) {
if assert.NoError(t, err, output) {
Expand All @@ -954,10 +954,10 @@ func (s *CLISuite) TestRetryWorkflowWithContinueOn() {
ExpectWorkflow(func(t *testing.T, metadata *metav1.ObjectMeta, status *wfv1.WorkflowStatus) {
workflowName = metadata.Name
assert.Equal(t, wfv1.WorkflowFailed, status.Phase)
assert.Equal(t, 6, len(status.Nodes))
assert.Equal(t, 7, len(status.Nodes))
}).
ExpectWorkflowNode(func(status wfv1.NodeStatus) bool {
return strings.Contains(status.Name, "retry-workflow-with-continueon.success")
return strings.Contains(status.Name, ".success")
}, func(t *testing.T, status *wfv1.NodeStatus, pod *corev1.Pod) {
assert.Equal(t, 2, len(status.Children))
})
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/testdata/retry-workflow-with-continueon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ spec:
entrypoint: dag
templates:
- name: dag
retryStrategy:
limit: 2
retryPolicy: OnError
dag:
failFast: false
tasks:
Expand Down
2 changes: 1 addition & 1 deletion workflow/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ func FormulateRetryWorkflow(ctx context.Context, wf *wfv1.Workflow, restartSucce
log.Debugf("Reset %s node %s since it's a group node", node.Name, string(node.Phase))
continue
} else {
if isDescendantNodeSucceeded(wf, node, nodeIDsToReset) {
if node.Type != wfv1.NodeTypeRetry && isDescendantNodeSucceeded(wf, node, nodeIDsToReset) {
log.Debugf("Node %s remains as is since it has succeed child nodes.", node.Name)
newWF.Status.Nodes.Set(node.ID, node)
continue
Expand Down