-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: fix bugs in retryWorkflow if failed pod node has children nodes. Fix #9244 #9285
Conversation
Signed-off-by: smile-luobin <smile.luobin@gmail.com>
Signed-off-by: smile-luobin <smile.luobin@gmail.com>
Signed-off-by: smile-luobin <smile.luobin@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix! I left some comments.
workflow/util/util.go
Outdated
descendantNodeIDs := getDescendantNodeIDs(wf, node) | ||
for _, descendantNodeID := range descendantNodeIDs { | ||
deletedNodes[descendantNodeID] = true | ||
descendantNode := wf.Status.Nodes[descendantNodeID] | ||
if descendantNode.Type == wfv1.NodeTypePod { | ||
templateName := getTemplateFromNode(descendantNode) | ||
version := GetWorkflowPodNameVersion(wf) | ||
podName := PodName(wf.Name, descendantNode.Name, templateName, descendantNode.ID, version) | ||
podsToDelete = append(podsToDelete, podName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect there will be redundant pod names here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
workflow/util/util.go
Outdated
version := GetWorkflowPodNameVersion(wf) | ||
podName := PodName(wf.Name, descendantNode.Name, templateName, descendantNode.ID, version) | ||
podsToDelete = append(podsToDelete, podName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor this? Similar code above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
workflow/util/util_test.go
Outdated
//assert.Equal(t, wfv1.NodeRunning, wf.Status.Nodes["3"].Phase) | ||
//assert.Equal(t, wfv1.NodeRunning, wf.Status.Nodes["4"].Phase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
workflow/util/util_test.go
Outdated
assert.Equal(t, wfv1.NodeSucceeded, wf.Status.Nodes["my-nested-dag-2"].Phase) | ||
// This should be running since it's node #4's parent node. | ||
assert.Equal(t, wfv1.NodeRunning, wf.Status.Nodes["1"].Phase) | ||
// This should be running since it's node #1's child node and node #1 is being retried. | ||
assert.Equal(t, wfv1.NodeRunning, wf.Status.Nodes["2"].Phase) | ||
assert.Equal(t, wfv1.NodeSucceeded, wf.Status.Nodes["3"].Phase) | ||
assert.Equal(t, wfv1.NodeRunning, wf.Status.Nodes["4"].Phase) | ||
//assert.Equal(t, wfv1.NodeRunning, wf.Status.Nodes["4"].Phase) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
workflow/util/util_test.go
Outdated
workflows.argoproj.io/completed: "true" | ||
workflows.argoproj.io/phase: Failed | ||
workflows.argoproj.io/resubmitted-from-workflow: test-pipeline-t5h77 | ||
managedFields: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? Can we make this YAML more concise and only contain what's needed for the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: smile-luobin <smile.luobin@gmail.com>
Signed-off-by: smile-luobin <smile.luobin@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
…Fix argoproj#9244 (argoproj#9285) * feat: fix bugs in retry workflow if failed node has children nodes. Signed-off-by: smile-luobin <smile.luobin@gmail.com> * Fix bugs in retryWorkflow Signed-off-by: smile-luobin <smile.luobin@gmail.com> * refactor the method that gets the descendantNodes Signed-off-by: smile-luobin <smile.luobin@gmail.com> * do some refactoring Signed-off-by: smile-luobin <smile.luobin@gmail.com> * fix bugs, and add more checks in test Signed-off-by: smile-luobin <smile.luobin@gmail.com> Signed-off-by: smile-luobin <smile.luobin@gmail.com> Signed-off-by: juchao <juchao@coscene.io>
Fix bugs in retry workflow if the failed node has children nodes. Fix #9244.
For example. node
t2
was failed, but it has child nodet3
.