mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
add additional string.contains case for jenkins package by group id
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
d9de63c837
commit
24a2f9344b
@ -1,6 +1,8 @@
|
||||
package pkg
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/anchore/syft/internal"
|
||||
"github.com/package-url/packageurl-go"
|
||||
)
|
||||
@ -35,7 +37,7 @@ type PomProperties struct {
|
||||
|
||||
// PkgTypeIndicated returns the package Type indicated by the data contained in the PomProperties.
|
||||
func (p PomProperties) PkgTypeIndicated() Type {
|
||||
if internal.HasAnyOfPrefixes(p.GroupID, JenkinsPluginPomPropertiesGroupIDs...) {
|
||||
if internal.HasAnyOfPrefixes(p.GroupID, JenkinsPluginPomPropertiesGroupIDs...) || strings.Contains(p.GroupID, ".jenkins.plugin") {
|
||||
return JenkinsPluginPkg
|
||||
}
|
||||
|
||||
|
||||
@ -90,6 +90,17 @@ func TestPomProperties_PkgTypeIndicated(t *testing.T) {
|
||||
},
|
||||
expectedType: JenkinsPluginPkg,
|
||||
},
|
||||
{
|
||||
name: "jenkins.plugin somewhere in group id",
|
||||
pomProperties: PomProperties{
|
||||
Path: "some path",
|
||||
Name: "some name",
|
||||
GroupID: "org.wagoodman.jenkins.plugins.something",
|
||||
ArtifactID: "some artifact ID",
|
||||
Version: "1",
|
||||
},
|
||||
expectedType: JenkinsPluginPkg,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user