mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
fix(purl): skip unsupported library type (#4577)
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package library
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
|
||||
@@ -11,12 +9,9 @@ import (
|
||||
|
||||
// Detect scans and returns vulnerabilities of library
|
||||
func Detect(libType string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) {
|
||||
driver, err := NewDriver(libType)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrSBOMSupportOnly) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, xerrors.Errorf("failed to initialize a driver: %w", err)
|
||||
driver, ok := NewDriver(libType)
|
||||
if !ok {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
vulns, err := detect(driver, pkgs)
|
||||
|
||||
Reference in New Issue
Block a user