-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(sbom): fix error when parent of SPDX Relationships is not a package. #6399
fix(sbom): fix error when parent of SPDX Relationships is not a package. #6399
Conversation
@DmitriyLewen Could you add a test? I'd like to fully understand the case. |
// Check the wrong parent to avoid `panic` | ||
if parent == nil { | ||
return | ||
} |
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.
I added parent check in SPDX package (like we do for CycloneDX). But I added 1 more check here so that we don't panic if we use this function later somewhere else.
This may be additional change or we may want to add a log message here.
@knqyf263 wdyt?
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.
Looks good
Description
When parent from Relationship is not package (e.g. File) - Trivy returns error. (see #6391)
e.g.:
We only need to add to BOM Relationships relationships between packages
Related issues
Checklist