Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: dervoeti <lukas.voetmand@stackable.tech>
  • Loading branch information
anchore-actions-token-generator[bot] authored and dervoeti committed Nov 18, 2024
1 parent e41f8df commit 6191172
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .binny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tools:
# used to release all artifacts
- name: goreleaser
version:
want: v2.4.4
want: v2.4.5
method: github-release
with:
repo: goreleaser/goreleaser
Expand Down Expand Up @@ -111,7 +111,7 @@ tools:
# used for triggering a release
- name: gh
version:
want: v2.61.0
want: v2.62.0
method: github-release
with:
repo: cli/cli
Expand Down
11 changes: 7 additions & 4 deletions syft/format/internal/cyclonedxutil/helpers/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ func collectBomPackages(bom *cyclonedx.BOM, s *sbom.SBOM, idMap map[string]inter
componentsPresent := false
if bom.Components != nil {
for i := range *bom.Components {
collectPackages(&(*bom.Components)[i], s, idMap)
collectPackages(&(*bom.Components)[i], s, bom, idMap)
}
componentsPresent = true
}

if bom.Metadata != nil && bom.Metadata.Component != nil {
collectPackages(bom.Metadata.Component, s, idMap)
collectPackages(bom.Metadata.Component, s, bom, idMap)
componentsPresent = true
}

Expand All @@ -59,7 +59,7 @@ func collectBomPackages(bom *cyclonedx.BOM, s *sbom.SBOM, idMap map[string]inter
return nil
}

func collectPackages(component *cyclonedx.Component, s *sbom.SBOM, idMap map[string]interface{}) {
func collectPackages(component *cyclonedx.Component, s *sbom.SBOM, bom *cyclonedx.BOM, idMap map[string]interface{}) {
switch component.Type {
case cyclonedx.ComponentTypeOS:
case cyclonedx.ComponentTypeContainer:
Expand All @@ -71,13 +71,16 @@ func collectPackages(component *cyclonedx.Component, s *sbom.SBOM, idMap map[str
idMap[syftID] = p
}
// TODO there must be a better way than needing to call this manually:
var oldName = p.Name
p.Name = bom.SerialNumber + p.Name
p.SetID()
p.Name = oldName
s.Artifacts.Packages.Add(*p)
}

if component.Components != nil {
for i := range *component.Components {
collectPackages(&(*component.Components)[i], s, idMap)
collectPackages(&(*component.Components)[i], s, bom, idMap)
}
}
}
Expand Down

0 comments on commit 6191172

Please sign in to comment.