Skip to content

Commit

Permalink
fix(purl): add missed os types (#6955)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen authored Jun 19, 2024
1 parent 417212e commit 2d85a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integration/testdata/mariner-1.0.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"VulnerabilityID": "CVE-2022-0261",
"PkgName": "vim",
"PkgIdentifier": {
"PURL": "pkg:cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64",
"PURL": "pkg:rpm/cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64\u0026distro=cbl-mariner-1.0.20220122",
"UID": "3f08cd76fa5ba73d"
},
"InstalledVersion": "8.2.4081-1.cm1",
Expand Down Expand Up @@ -79,7 +79,7 @@
"VulnerabilityID": "CVE-2022-0158",
"PkgName": "vim",
"PkgIdentifier": {
"PURL": "pkg:cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64",
"PURL": "pkg:rpm/cbl-mariner/vim@8.2.4081-1.cm1?arch=x86_64\u0026distro=cbl-mariner-1.0.20220122",
"UID": "3f08cd76fa5ba73d"
},
"InstalledVersion": "8.2.4081-1.cm1",
Expand Down
5 changes: 3 additions & 2 deletions pkg/purl/purl.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,14 @@ func purlType(t ftypes.TargetType) string {
return packageurl.TypePub
case ftypes.RustBinary, ftypes.Cargo:
return packageurl.TypeCargo
case ftypes.Alpine:
case ftypes.Alpine, ftypes.Chainguard, ftypes.Wolfi:
return packageurl.TypeApk
case ftypes.Debian, ftypes.Ubuntu:
return packageurl.TypeDebian
case ftypes.RedHat, ftypes.CentOS, ftypes.Rocky, ftypes.Alma,
ftypes.Amazon, ftypes.Fedora, ftypes.Oracle, ftypes.OpenSUSE,
ftypes.OpenSUSELeap, ftypes.OpenSUSETumbleweed, ftypes.SLES, ftypes.Photon:
ftypes.OpenSUSELeap, ftypes.OpenSUSETumbleweed, ftypes.SLES, ftypes.Photon,
ftypes.CBLMariner:
return packageurl.TypeRPM
case TypeOCI:
return packageurl.TypeOCI
Expand Down

0 comments on commit 2d85a00

Please sign in to comment.