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

Fixed for build-time container image SBOMs #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

twaugh
Copy link
Collaborator

@twaugh twaugh commented Sep 11, 2024

No description provided.

@twaugh twaugh requested a review from mprpic September 11, 2024 14:55
for purl_ref in [ref for ref in pkg.get("externalRefs", []) if ref["referenceType"] == "purl"]:
purl = PackageURL.from_string(purl_ref["referenceLocator"])
if purl.type == "oci":
purl.qualifiers.pop("tag", None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the tag always known at build time? I was under the impression that it was created at release time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twaugh Any thoughts on ^^^?

]
print(f"Described: {described}\nVariants: {variants}")
built = described + variants
for pkg in [pkg for pkg in sbom["packages"] if pkg["SPDXID"] in built]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this change. Is this just trying to filter down the packages to those that might represent images? Would there be other packages not using either DESCRIBES or VARIANT_OF that would be of type oci?

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