-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: sweep executions of image scan job #18649
Conversation
Codecov Report
@@ Coverage Diff @@
## main #18649 +/- ##
==========================================
- Coverage 67.40% 67.37% -0.04%
==========================================
Files 984 984
Lines 107029 107029
Branches 2670 2670
==========================================
- Hits 72139 72106 -33
- Misses 31005 31040 +35
+ Partials 3885 3883 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
87d85ba
to
0460159
Compare
@@ -1 +1,7 @@ | |||
CREATE INDEX IF NOT EXISTS idx_task_extra_attrs_report_uuids ON task USING gin ((extra_attrs::jsonb->'report_uuids')); | |||
|
|||
/* Set the vendor_id of IMAGE_SCAN to the artifact id instead of scanner id, which facilitates execution sweep */ |
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.
Could you please elaborate why changing the vendor_id of IMAGE_SCAN from scanner-id to artifact-id will facilitate the execution sweep? Thanks
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.
Currently, the unified sweep logic is cleaning the executions by vendor_id
, an easy-to-understand example is replication, we set the vendor_id
to replication policy id then we can retain fixed executions per policy, likewise for scanning, we want retain one execution for every artifact so need the vendor_id
to be the artifact id.
1. Change the SCAN_ALL job execution retain counts from 5 to 1(per current design, only one report be stored for every artifact, so retain latest 1 is enough). 2. Enable the sweep for IMAGE_SCAN job(retain latest 1). Fixes: goharbor#18633 Signed-off-by: chlins <[email protected]>
0460159
to
2bd45f7
Compare
1. Change the SCAN_ALL job execution retain counts from 5 to 1(per current design, only one report be stored for every artifact, so retain latest 1 is enough). 2. Enable the sweep for IMAGE_SCAN job(retain latest 1). Fixes: goharbor#18633 Signed-off-by: chlins <[email protected]> Signed-off-by: Wilfred Almeida <[email protected]>
Fixes: #18633
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #18633
Please indicate you've done the following: