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: sync hooks should be deleted after sync phase/wave completion #92

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

alexmt
Copy link
Contributor

@alexmt alexmt commented Jul 14, 2020

Closes argoproj/argo-cd#2737

PR changes hook deletion logic so that hooks are deleted after sync phase/wave is completed.

@alexmt alexmt requested review from jannfis and mayzhang2000 July 14, 2020 23:37
Copy link
Member

@jannfis jannfis left a 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!

return task.isHook() && task.liveObj != nil && !task.running() && task.deleteOnPhaseCompletion()
})
for _, task := range hooksPendingDeletion {
if task.deleteOnPhaseCompletion() {
Copy link
Member

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.

Copy link
Contributor Author

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) {
Copy link
Member

Choose a reason for hiding this comment

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

👍 😄

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 4 Code Smells

No Coverage information No Coverage information
2.6% 2.6% Duplication

@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #92 into master will increase coverage by 1.48%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
pkg/sync/sync_context.go 71.84% <72.72%> (+7.95%) ⬆️
pkg/sync/sync_task.go 98.36% <100.00%> (+0.02%) ⬆️

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 ee1db09...85f170b. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

helm hooks are deleted right after creation, not after all hooks are created
2 participants