fix: support traefik binary from the official Docker image (#2484)

Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
This commit is contained in:
Laurent Goderre 2024-01-10 10:57:32 -05:00 committed by GitHub
parent e61aac0b53
commit fecfb2f939
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

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

View File

@ -214,7 +214,7 @@ func DefaultClassifiers() []Classifier {
EvidenceMatcher: FileContentsVersionMatcher(
// [NUL]v1.7.34[NUL]
// [NUL]2.9.6[NUL]
`(?m)\x00v?(?P<version>[0-9]+\.[0-9]+\.[0-9]+(-alpha[0-9]|-beta[0-9]|-rc[0-9])?)\x00`),
`(?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"),
},

View File

@ -329,6 +329,13 @@ from-images:
paths:
- /usr/local/bin/traefik
- version: 2.10.7
images:
- ref: traefik:2.10.7@sha256:a98415716a91066ef5e442969887ebb3df7d80775b5bfa7b67fcaed989833d84
platform: linux/amd64
paths:
- /usr/local/bin/traefik
# from the original dynamic fixtures...