Skip to content
Open
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
1 change: 1 addition & 0 deletions grype/distro/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ var aliasTypes = map[string]Type{
"Alpine Linux": Alpine, // needed for CPE matching (see #2039)
"windows": Windows,
"scientific linux": Scientific, // Scientific linux prior to v7 didn't have an os-release file and syft raises up "scientific linux" as the release id as parsed from /etc/redhat-release
"amazon_linux": AmazonLinux,
}

var typeToIDMapping = map[Type]string{}
Expand Down
8 changes: 8 additions & 0 deletions grype/distro/type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ func TestTypeFromRelease(t *testing.T) {
},
want: Scientific,
},
{
name: "amazon_linux alias",
release: linux.Release{
ID: "amazon_linux",
VersionID: "2",
},
want: AmazonLinux,
},
}

for _, tt := range tests {
Expand Down