fix: traefik classifier (#3077)

Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2024-07-29 22:46:51 +09:00 committed by GitHub
parent 1cd75b7d68
commit 490e05adb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 1 deletions

View file

@ -204,6 +204,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("traefik-binary"),
},
},
{
logicalFixture: "traefik/3.0.4/linux-riscv64",
expected: pkg.Package{
Name: "traefik",
Version: "3.0.4",
Type: "binary",
PURL: "pkg:generic/traefik@3.0.4",
Locations: locations("traefik"),
Metadata: metadata("traefik-binary"),
},
},
{
logicalFixture: "memcached/1.6.18/linux-amd64",
expected: pkg.Package{

View file

@ -263,7 +263,8 @@ func DefaultClassifiers() []Classifier {
EvidenceMatcher: FileContentsVersionMatcher(
// [NUL]v1.7.34[NUL]
// [NUL]2.9.6[NUL]
`(?m)(\x00|\x{FFFD})v?(?P<version>[0-9]+\.[0-9]+\.[0-9]+(-alpha[0-9]|-beta[0-9]|-rc[0-9])?)\x00`),
// 3.0.4[NUL]
`(?m)(\x00|\x{FFFD})?v?(?P<version>[0-9]+\.[0-9]+\.[0-9]+(-alpha[0-9]|-beta[0-9]|-rc[0-9])?)\x00`),
Package: "traefik",
PURL: mustPURL("pkg:generic/traefik@version"),
CPEs: singleCPE("cpe:2.3:a:traefik:traefik:*:*:*:*:*:*:*:*"),

View file

@ -448,6 +448,12 @@ from-images:
paths:
- /usr/local/bin/traefik
- version: 3.0.4
images:
- ref: traefik:3.0.4@sha256:12a7cc4232b5b7fe027673da8c096144525f59a8eabc87e52260aac0ec5a1219
platform: linux/riscv64
paths:
- /usr/local/bin/traefik
# from the original dynamic fixtures...