Skip to content

Commit

Permalink
buildah: Properly missing components property in syft-generated SBOM
Browse files Browse the repository at this point in the history
When the Syft SBOM didn't have the components property, the output was
generated incorrectly because - the default empty list needed to be
added back to image_sbom.
  • Loading branch information
owtaylor committed Jul 16, 2024
1 parent dd52262 commit bf61013
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion task/buildah-oci-ta/0.1/buildah-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ spec:
def get_identifier(component):
return component["name"] + '@' + component.get("version", "")
image_sbom_components = image_sbom.get("components", [])
image_sbom_components = image_sbom.setdefault("components", [])
existing_components = [get_identifier(component) for component in image_sbom_components]
source_sbom_components = source_sbom.get("components", [])
Expand Down
2 changes: 1 addition & 1 deletion task/buildah-remote-oci-ta/0.1/buildah-remote-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ spec:
def get_identifier(component):
return component["name"] + '@' + component.get("version", "")
image_sbom_components = image_sbom.get("components", [])
image_sbom_components = image_sbom.setdefault("components", [])
existing_components = [get_identifier(component) for component in image_sbom_components]
source_sbom_components = source_sbom.get("components", [])
Expand Down
2 changes: 1 addition & 1 deletion task/buildah-remote/0.1/buildah-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ spec:
def get_identifier(component):
return component["name"] + '@' + component.get("version", "")
image_sbom_components = image_sbom.get("components", [])
image_sbom_components = image_sbom.setdefault("components", [])
existing_components = [get_identifier(component) for component in image_sbom_components]
source_sbom_components = source_sbom.get("components", [])
Expand Down
2 changes: 1 addition & 1 deletion task/buildah/0.1/buildah.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ spec:
def get_identifier(component):
return component["name"] + '@' + component.get("version", "")
image_sbom_components = image_sbom.get("components", [])
image_sbom_components = image_sbom.setdefault("components", [])
existing_components = [get_identifier(component) for component in image_sbom_components]
source_sbom_components = source_sbom.get("components", [])
Expand Down

0 comments on commit bf61013

Please sign in to comment.