mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
feat: add traefik classifier (#1504)
Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
parent
a1b82c9664
commit
0853a50f4d
@ -19,6 +19,34 @@ func TestClassifierCataloger_DefaultClassifiers_PositiveCases(t *testing.T) {
|
|||||||
fixtureDir string
|
fixtureDir string
|
||||||
expected pkg.Package
|
expected pkg.Package
|
||||||
}{
|
}{
|
||||||
|
{
|
||||||
|
name: "positive-traefik-2.9.6",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/traefik-2.9.6",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "traefik",
|
||||||
|
Version: "2.9.6",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/traefik@2.9.6",
|
||||||
|
Locations: singleLocation("traefik"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "traefik-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "positive-traefik-1.7.34",
|
||||||
|
fixtureDir: "test-fixtures/classifiers/positive/traefik-1.7.34",
|
||||||
|
expected: pkg.Package{
|
||||||
|
Name: "traefik",
|
||||||
|
Version: "1.7.34",
|
||||||
|
Type: "binary",
|
||||||
|
PURL: "pkg:generic/traefik@1.7.34",
|
||||||
|
Locations: singleLocation("traefik"),
|
||||||
|
Metadata: pkg.BinaryMetadata{
|
||||||
|
Classifier: "traefik-binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "positive-memcached-1.6.18",
|
name: "positive-memcached-1.6.18",
|
||||||
fixtureDir: "test-fixtures/classifiers/positive/memcached-1.6.18",
|
fixtureDir: "test-fixtures/classifiers/positive/memcached-1.6.18",
|
||||||
|
|||||||
@ -165,4 +165,14 @@ var defaultClassifiers = []classifier{
|
|||||||
Package: "memcached",
|
Package: "memcached",
|
||||||
PURL: mustPURL("pkg:generic/memcached@version"),
|
PURL: mustPURL("pkg:generic/memcached@version"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Class: "traefik-binary",
|
||||||
|
FileGlob: "**/traefik",
|
||||||
|
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`),
|
||||||
|
Package: "traefik",
|
||||||
|
PURL: mustPURL("pkg:generic/traefik@version"),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user