-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sweep executions of image scan job
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: #18633 Signed-off-by: chlins <chenyuzh@vmware.com>
- Loading branch information
Showing
3 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ | ||
UPDATE execution SET vendor_id = (extra_attrs -> 'artifact' ->> 'id')::integer | ||
WHERE jsonb_path_exists(extra_attrs::jsonb, '$.artifact.id') | ||
AND vendor_id IN (SELECT id FROM scanner_registration) | ||
AND vendor_type = 'IMAGE_SCAN'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters