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

add_image_reference: improve virtual roots handling #213

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

chmeliik
Copy link
Contributor

@chmeliik chmeliik commented Jan 3, 2025

See the individual commit messages for more details

@chmeliik chmeliik requested a review from a team as a code owner January 3, 2025 10:39
@chmeliik chmeliik force-pushed the more-virtual-packages branch from 934104f to 37e96e5 Compare January 7, 2025 15:04
When the input SBOM had two or more "virtual roots", the script did not
work correctly; there was a chance it would only delete one of them. The
root cause was deleting items from a list while iterating over it.
Iterate over a copy of the list instead.

Signed-off-by: Adam Cmiel <[email protected]>
When scanning a directory, Syft (and perhaps cachi2 as well - to be
determined) uses the directory name for the root element. The element
may look e.g. like this

    {
        "SPDXID": "SPDXRef-DocumentRoot-Directory-.-some-directory",
        "name": "./some-directory"
    }

Consider such elements to be "virtual roots" as well.

Signed-off-by: Adam Cmiel <[email protected]>
@chmeliik chmeliik force-pushed the more-virtual-packages branch from 37e96e5 to 9c1a572 Compare January 8, 2025 09:27
@chmeliik chmeliik merged commit c8362a6 into konflux-ci:main Jan 8, 2025
4 checks passed
@chmeliik chmeliik deleted the more-virtual-packages branch January 8, 2025 12:18
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.

2 participants