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: Consider onExit children of Retry nodes #6451

Merged
merged 4 commits into from
Aug 3, 2021

Conversation

simster7
Copy link
Member

Fixes: #6301

Checklist:

Tips:

  • Your PR needs to pass the required checks before it can be approved. If the check is not required (e.g. E2E tests) it does not need to pass
  • Sign-off your commits to pass the DCO check: git commit --signoff.
  • Run make pre-commit -B to fix codegen or lint problems.
  • Say how how you tested your changes. If you changed the UI, attach screenshots.

Signed-off-by: Simon Behar <[email protected]>
@simster7
Copy link
Member Author

@sarabala1979 Please review

@codecov
Copy link

codecov bot commented Jul 29, 2021

Codecov Report

Merging #6451 (e77c923) into master (b16a0a0) will increase coverage by 0.14%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6451      +/-   ##
==========================================
+ Coverage   48.35%   48.49%   +0.14%     
==========================================
  Files         259      260       +1     
  Lines       18682    18756      +74     
==========================================
+ Hits         9033     9096      +63     
- Misses       8660     8665       +5     
- Partials      989      995       +6     
Impacted Files Coverage Δ
workflow/controller/operator.go 72.15% <72.72%> (-0.34%) ⬇️
workflow/controller/dag.go 75.63% <100.00%> (-0.07%) ⬇️
cmd/argoexec/commands/emissary.go 50.35% <0.00%> (-1.44%) ⬇️
server/auth/sso/sso.go 24.85% <0.00%> (-1.05%) ⬇️
workflow/controller/workflowpod.go 74.56% <0.00%> (-0.13%) ⬇️
pkg/apiclient/argo-kube-client.go 0.00% <0.00%> (ø)
pkg/apiclient/logs-intermediary.go 0.00% <0.00%> (ø)
workflow/controller/retry_tweak.go 100.00% <0.00%> (ø)
pkg/apiclient/watch-intermediary.go 0.00% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b16a0a0...e77c923. Read the comment docs.

Signed-off-by: Simon Behar <[email protected]>
var childrenIds []string
for i := -1; i >= -len(node.Children); i-- {
node := getChildNodeIndex(node, nodes, i)
if strings.HasSuffix(node.Name, ".onExit") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need nil here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We technically don't, because the only time getChildNodeIndex returns nil is when len(node.Children) == 0, but since this is inside the for loop guarded by that it should never happen. However, getChildNodeIndex could change under us so it's always safer to add a nil check.

Signed-off-by: Simon Behar <[email protected]>
@sarabala1979
Copy link
Member

@simster7 do you want to include this PR on v3.1.4?

@simster7 simster7 merged commit 7ef0f47 into argoproj:master Aug 3, 2021
@simster7
Copy link
Member Author

simster7 commented Aug 3, 2021

Sure

@sarabala1979 sarabala1979 mentioned this pull request Aug 3, 2021
49 tasks
@sarabala1979
Copy link
Member

This PR will be included in 3.2 because of it uses 3.2 code

@sarabala1979 sarabala1979 mentioned this pull request Aug 11, 2021
28 tasks
@agilgur5 agilgur5 added area/controller Controller issues, panics area/hooks area/exit-handler area/retryStrategy Template-level retryStrategy labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Controller issues, panics area/exit-handler area/hooks area/retryStrategy Template-level retryStrategy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Step hangs forever w/ retryStrategy added to templates (possibly related to Lifecycle hooks)
3 participants