ROX-33339: Return ScanReused when enrichment uses existing scan #19827
Merged
ROX-33339: Return ScanReused when enrichment uses existing scan #19827
Conversation
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
|
Skipping CI for Draft Pull Request. |
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
🚀 Build Images ReadyImages are ready for commit 7f56c20. To use with deploy scripts: export MAIN_IMAGE_TAG=4.11.x-575-g7f56c20e93 |
a85dbb2 to
a1cf896
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19827 +/- ##
==========================================
- Coverage 49.60% 49.60% -0.01%
==========================================
Files 2763 2763
Lines 208339 208331 -8
==========================================
- Hits 103342 103337 -5
+ Misses 97332 97328 -4
- Partials 7665 7666 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a1cf896 to
81241af
Compare
81241af to
e516610
Compare
e516610 to
a753bc4
Compare
Contributor
Author
|
/test all |
Contributor
Author
|
/test ocp-4-21-qa-e2e-tests |
dcaravel
approved these changes
Apr 6, 2026
charmik-redhat
approved these changes
Apr 6, 2026
6211fa0 to
8e833aa
Compare
Contributor
Author
|
/test gke-upgrade-tests |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The image enricher returns
ScanSucceededwhen reusing an existing scan from the database, makingImageUpdatedalwaystrueeven when no image data changed. This prevents downstream consumers from distinguishing genuinely updated images from unchanged ones, and results in a significant volume of unnecessaryUpdateImagemessages to secured clusters, and subsequentstorage.Imageproto deserialization in Sensor.This PR introduces a
ScanReusedenum value inScanResult, returned when the enricher reuses an existing DB scan unchanged.ImageUpdatednow correctly evaluates tofalsefor these images, enabling the rest of the targeted admission controller cache invalidation stack to optimize message flow in the short-circuit reprocessor path. Given the image proto can be large, with scan data for large number of CVEs, metadata and image signatures, and multiple secured clusters, this constitutes significant savings.A
HasScanData()helper has been added toScanResultto avoid regressions in API paths (roxctl image scan, SBOM export,WatchImage) that validate scan presence - these paths now accept bothScanSucceededandScanReusedas valid.Note:
Future PRs will use
imageUpdatedto decide betweenUpdatedImagemessages (for each changed image) vs. a batchedRefreshImageCacheTTLmessage (for unchanged images) in the short-circuit reprocessor path. Without this fix, the absence of accurateImageUpdatedflag, makes future optimizations impossible.User-facing documentation
Testing and quality
Automated testing
How I validated my change
ScanReusedis returned whenuseExistingScanis true, andImageUpdatedisfalsein that caseTestHasScanDatacovers allScanResultenum valuesScanReusedreturning HTTP 200 (regression check)ScanResultconsumers to confirm no regressions: periodic reprocessor usesForceRefetchCachedValuesOnly(never hitsScanReused);WatchImageusesIgnoreExistingImages(never hitsScanReused);ScanImageand SBOM export useUseCachesIfPossible(can hitScanReused, covered byHasScanData())