diff --git a/pkg/sbom/core/bom.go b/pkg/sbom/core/bom.go index d6ee429a0576..632bc37123b1 100644 --- a/pkg/sbom/core/bom.go +++ b/pkg/sbom/core/bom.go @@ -273,7 +273,7 @@ func (b *BOM) AddVulnerability(c *Component, vuln Vulnerability) { b.vulnerabilities[c.id] = append(b.vulnerabilities[c.id], vuln) } -func (b *BOM) AddVulnerabilities(c *Component, vulns []Vulnerability) { +func (b *BOM) SetVulnerabilities(c *Component, vulns []Vulnerability) { if c.id == uuid.Nil { b.AddComponent(c) } diff --git a/pkg/sbom/io/encode.go b/pkg/sbom/io/encode.go index a91ae2965036..11d37455538c 100644 --- a/pkg/sbom/io/encode.go +++ b/pkg/sbom/io/encode.go @@ -219,7 +219,7 @@ func (e *Encoder) encodePackages(parent *core.Component, result types.Result) { // Add vulnerabilities if vv := vulns[pkg.Identifier.UID]; vv != nil { - e.bom.AddVulnerabilities(c, vv) + e.bom.SetVulnerabilities(c, vv) } // Handle a root package