Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Ignore invalid purls
Browse files Browse the repository at this point in the history
  • Loading branch information
cdupuis committed Jan 29, 2023
1 parent d7a1246 commit d4311a3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sbom/trivy.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ func trivySbom(cache *registry.ImageCache, lm *types.LayerMapping, resultChan ch
url := fmt.Sprintf(`pkg:golang/%s@%s`, lib.Name, lib.Version)
purl, err := types.ToPackageUrl(url)
if err != nil {
result.Status = types.Failed
result.Error = errors.Wrapf(err, "failed to create purl from %s", url)
break
skill.Log.Warnf("failed to create purl from %s", url)
continue
}
pkg := types.Package{
Purl: purl.String(),
Expand All @@ -194,10 +193,8 @@ func trivySbom(cache *registry.ImageCache, lm *types.LayerMapping, resultChan ch
url := fmt.Sprintf(`pkg:maven/%s/%s@%s`, namespace, name, lib.Version)
purl, err := types.ToPackageUrl(url)
if err != nil {
result.Status = types.Failed
result.Error = errors.Wrapf(err, "failed to create purl from %s", url)
resultChan <- result
return
skill.Log.Warnf("failed to create purl from %s", url)
continue
}
pkg := types.Package{
Purl: purl.String(),
Expand Down

0 comments on commit d4311a3

Please sign in to comment.