Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit d4311a3

Browse files
committed
Ignore invalid purls
1 parent d7a1246 commit d4311a3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

sbom/trivy.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ func trivySbom(cache *registry.ImageCache, lm *types.LayerMapping, resultChan ch
167167
url := fmt.Sprintf(`pkg:golang/%s@%s`, lib.Name, lib.Version)
168168
purl, err := types.ToPackageUrl(url)
169169
if err != nil {
170-
result.Status = types.Failed
171-
result.Error = errors.Wrapf(err, "failed to create purl from %s", url)
172-
break
170+
skill.Log.Warnf("failed to create purl from %s", url)
171+
continue
173172
}
174173
pkg := types.Package{
175174
Purl: purl.String(),
@@ -194,10 +193,8 @@ func trivySbom(cache *registry.ImageCache, lm *types.LayerMapping, resultChan ch
194193
url := fmt.Sprintf(`pkg:maven/%s/%s@%s`, namespace, name, lib.Version)
195194
purl, err := types.ToPackageUrl(url)
196195
if err != nil {
197-
result.Status = types.Failed
198-
result.Error = errors.Wrapf(err, "failed to create purl from %s", url)
199-
resultChan <- result
200-
return
196+
skill.Log.Warnf("failed to create purl from %s", url)
197+
continue
201198
}
202199
pkg := types.Package{
203200
Purl: purl.String(),

0 commit comments

Comments
 (0)