Skip to content

Commit

Permalink
add syft binary jre/jdk packages
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman committed Sep 18, 2024
1 parent d997b31 commit eeb9755
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion grype/pkg/java_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func IsJvmPackage(p Package) bool {
return false
}

var jvmIndications = strset.New("java_se", "jre", "jdk", "zulu", "openjdk", "java")
var jvmIndications = strset.New("java_se", "jre", "jdk", "zulu", "openjdk", "java", "java/jre", "java/jdk")

func HasJvmPackageName(name string) bool {
return jvmIndications.Has(name)
Expand Down
16 changes: 16 additions & 0 deletions grype/pkg/java_metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ func TestIsJvmPackage(t *testing.T) {
},
expected: true,
},
{
name: "binary package from syft (java/jdk",
pkg: Package{
Type: syftPkg.BinaryPkg,
Name: "java/jre",
},
expected: true,
},
{
name: "binary package from syft (java/jre)",
pkg: Package{
Type: syftPkg.BinaryPkg,
Name: "java/jdk",
},
expected: true,
},
{
name: "binary package without jvm-related name",
pkg: Package{
Expand Down

0 comments on commit eeb9755

Please sign in to comment.