ROX-27618: Add env var to disable RHEL lineage usage #1764
Merged
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
Builds on:
Adds env var
ROX_RHEL_LINEAGE
that when set tofalse
disables the use of lineage when storing/retrieving image layers. Note: that the database migration still runs that adds thelineage
andparent_lineage
columns torhelv2_layer
(added in the previous PR) - however the empty string is inserted into both fields as images are analyzed.Testing
Compared the results between two 4.6.1 ACS clusters with only the scanner image changed. A new scanner image was created based on 4.6.1 with only the scanner binary changed built from this PR. This was necessary because each PR includes a new genesis dump and even with the most recent vuln diffs applied scan results would differ.
To build the image:
And pushed to
quay.io/dcaravel/sandbox/scanner:lineage-env
Two clusters were setup, one with 4.6.1 and one with these changes. Two pods were created in each cluster using the test images created here. After all vulns were loaded, all images were re-scanned, and using this tool results compared with the new feature off vs. on. The below collapsed sections have the results of the diffs.
Diff: 4.6.1 to this PR with feature disabled
oc set env deploy/scanner ROX_RHEL_LINEAGE=false
Confirm new columns/indexes created (expected even though feature disabled):
Confirm new columns are not populated (expected when feature disabled):
Run diff tool - expect scanner images to differ between clusters but for the images in common the fields inspected by the diff tool are identical.
Diff: 4.6.1 to this PR with feature enabled
oc set env deploy/scanner ROX_RHEL_LINEAGE=true
Confirm new columns/indexes created:
Confirm new columns ARE populated:
Run diff tool - scanner images will still differ, additionally the lineage test images will differ in their detection of the java jdk, the other 89 images were identical.