-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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(controller): Fix workflows with retryStrategy left Running after completion #5497
Conversation
Signed-off-by: Simon Behar <simbeh7@gmail.com>
@@ -1802,7 +1802,7 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string, | |||
if retryNodeName != "" { | |||
retryNode := woc.wf.GetNodeByName(retryNodeName) | |||
if !retryNode.Fulfilled() && node.Fulfilled() { // if the retry child has completed we need to update outself | |||
node, err = woc.executeTemplate(ctx, retryNodeName, orgTmpl, tmplCtx, args, opts) | |||
retryNode, err = woc.executeTemplate(ctx, retryNodeName, orgTmpl, tmplCtx, args, opts) |
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.
This part of the code is responsible for ensuring the retry node gets marked as completed. In the case of affected workflows in this issue, this retry node is the root node.
The code works correctly, however, it currently doesn't return the updated node (in this change retryNode
), but the old node (node
). Simply return the updated node so that code downstream can act on the completed root node instead of an old and incomplete reference.
workflow/controller/operator_test.go
Outdated
@@ -6314,3 +6314,63 @@ func TestGenerateOutputResultRegex(t *testing.T) { | |||
assert.Equal(t, `steps\.template-name\.outputs\.result`, ref) | |||
assert.Equal(t, `steps\[['\"]template-name['\"]\]\.outputs.result`, expr) | |||
} | |||
|
|||
const rootRetryStrategyCompletes =`apiVersion: argoproj.io/v1alpha1 |
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've already ensured this is minimal
Codecov Report
@@ Coverage Diff @@
## master #5497 +/- ##
==========================================
+ Coverage 46.66% 46.69% +0.02%
==========================================
Files 240 240
Lines 14985 14985
==========================================
+ Hits 6993 6997 +4
+ Misses 7093 7089 -4
Partials 899 899
Continue to review full report at Codecov.
|
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 I ask for a clearer PR title - state what you are fixing rather than what you are changing?
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.
LGTM, Please fix the lint
Yup, will do so from now on |
…completion (#5497) Signed-off-by: Simon Behar <simbeh7@gmail.com>
Fixes: #5481
Signed-off-by: Simon Behar simbeh7@gmail.com
Checklist: