Skip to content

Commit 2d85a00

Browse files
authored
fix(purl): add missed os types (#6955)
1 parent 417212e commit 2d85a00

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

integration/testdata/mariner-1.0.json.golden

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"VulnerabilityID": "CVE-2022-0261",
4343
"PkgName": "vim",
4444
"PkgIdentifier": {
45-
"PURL": "pkg:cbl-mariner/[email protected]?arch=x86_64",
45+
"PURL": "pkg:rpm/cbl-mariner/[email protected]?arch=x86_64\u0026distro=cbl-mariner-1.0.20220122",
4646
"UID": "3f08cd76fa5ba73d"
4747
},
4848
"InstalledVersion": "8.2.4081-1.cm1",
@@ -79,7 +79,7 @@
7979
"VulnerabilityID": "CVE-2022-0158",
8080
"PkgName": "vim",
8181
"PkgIdentifier": {
82-
"PURL": "pkg:cbl-mariner/[email protected]?arch=x86_64",
82+
"PURL": "pkg:rpm/cbl-mariner/[email protected]?arch=x86_64\u0026distro=cbl-mariner-1.0.20220122",
8383
"UID": "3f08cd76fa5ba73d"
8484
},
8585
"InstalledVersion": "8.2.4081-1.cm1",

pkg/purl/purl.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,14 @@ func purlType(t ftypes.TargetType) string {
468468
return packageurl.TypePub
469469
case ftypes.RustBinary, ftypes.Cargo:
470470
return packageurl.TypeCargo
471-
case ftypes.Alpine:
471+
case ftypes.Alpine, ftypes.Chainguard, ftypes.Wolfi:
472472
return packageurl.TypeApk
473473
case ftypes.Debian, ftypes.Ubuntu:
474474
return packageurl.TypeDebian
475475
case ftypes.RedHat, ftypes.CentOS, ftypes.Rocky, ftypes.Alma,
476476
ftypes.Amazon, ftypes.Fedora, ftypes.Oracle, ftypes.OpenSUSE,
477-
ftypes.OpenSUSELeap, ftypes.OpenSUSETumbleweed, ftypes.SLES, ftypes.Photon:
477+
ftypes.OpenSUSELeap, ftypes.OpenSUSETumbleweed, ftypes.SLES, ftypes.Photon,
478+
ftypes.CBLMariner:
478479
return packageurl.TypeRPM
479480
case TypeOCI:
480481
return packageurl.TypeOCI

0 commit comments

Comments
 (0)