Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions syft/pkg/cataloger/binary/cataloger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion syft/pkg/cataloger/binary/default_classifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
Expand Down
Binary file not shown.
7 changes: 7 additions & 0 deletions syft/pkg/cataloger/binary/test-fixtures/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,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...

Expand Down