-
Notifications
You must be signed in to change notification settings - Fork 269
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: sync hooks should be deleted after sync phase/wave completion #92
Conversation
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.
Minor comment, see below. Otherwise, looks good to me!
pkg/sync/sync_context.go
Outdated
return task.isHook() && task.liveObj != nil && !task.running() && task.deleteOnPhaseCompletion() | ||
}) | ||
for _, task := range hooksPendingDeletion { | ||
if task.deleteOnPhaseCompletion() { |
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 check necessary? It's already part of the task filter 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.
nice catch, thank you! the check is not required - removed.
return nil, nil | ||
} | ||
|
||
func TestRunSync_HooksNotDeletedIfPhaseNotCompleted(t *testing.T) { |
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.
👍 😄
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
==========================================
+ Coverage 53.52% 55.01% +1.48%
==========================================
Files 25 25
Lines 2638 2643 +5
==========================================
+ Hits 1412 1454 +42
+ Misses 1086 1048 -38
- Partials 140 141 +1
Continue to review full report at Codecov.
|
Closes argoproj/argo-cd#2737
PR changes hook deletion logic so that hooks are deleted after sync phase/wave is completed.