feat: update haproxy classifier (#3277)

Signed-off-by: witchcraze <witchcraze@gmail.com>
This commit is contained in:
witchcraze 2024-10-03 04:10:39 +09:00 committed by GitHub
parent cc4f62b3d4
commit 263ea6b1bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 0 deletions

View File

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

View File

@ -196,6 +196,7 @@ func DefaultClassifiers() []Classifier {
Class: "haproxy-binary", Class: "haproxy-binary",
FileGlob: "**/haproxy", FileGlob: "**/haproxy",
EvidenceMatcher: evidenceMatchers( EvidenceMatcher: evidenceMatchers(
FileContentsVersionMatcher(`(?m)version (?P<version>[0-9]+\.[0-9]+(\.|-dev|-rc)[0-9]+)(-[a-z0-9]{7})?, released 20`),
FileContentsVersionMatcher(`(?m)HA-Proxy version (?P<version>[0-9]+\.[0-9]+(\.|-dev)[0-9]+)`), FileContentsVersionMatcher(`(?m)HA-Proxy version (?P<version>[0-9]+\.[0-9]+(\.|-dev)[0-9]+)`),
FileContentsVersionMatcher(`(?m)(?P<version>[0-9]+\.[0-9]+(\.|-dev)[0-9]+)-[0-9a-zA-Z]{7}.+HAProxy version`), FileContentsVersionMatcher(`(?m)(?P<version>[0-9]+\.[0-9]+(\.|-dev)[0-9]+)-[0-9a-zA-Z]{7}.+HAProxy version`),
), ),

View File

@ -130,6 +130,13 @@ from-images:
paths: paths:
- /usr/local/sbin/haproxy - /usr/local/sbin/haproxy
- version: 2.0.0
images:
- ref: haproxy:2.0.0@sha256:f88bca67a2782e7bd88af168d5c11216c32104d12fe9240fac54a1d3196e3f9c
platform: linux/amd64
paths:
- /usr/local/sbin/haproxy
- version: 2.7.3 - version: 2.7.3
images: images:
- ref: haproxy:2.7.3@sha256:17d8aa6bf16882a294bdcccc757dd4002045f34b719e9f94dfd4801614801aea - ref: haproxy:2.7.3@sha256:17d8aa6bf16882a294bdcccc757dd4002045f34b719e9f94dfd4801614801aea