Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: add amazon linux #119

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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
16 changes: 16 additions & 0 deletions util/imagetools/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ func TestNormalizeImageInfo(t *testing.T) {
OsLang: "",
OsArch: "x86_64",
},
{
Name: "Amazon Linux 2023 AMI",
OsDistro: "Amazon Linux",
OsType: osprofile.OS_TYPE_LINUX,
OsVersion: "2023",
OsLang: "",
OsArch: "x86_64",
},
{
Name: "Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type",
OsDistro: "Amazon Linux",
OsType: osprofile.OS_TYPE_LINUX,
OsVersion: "2",
OsLang: "",
OsArch: "x86_64",
},
}

for _, image := range images {
Expand Down
3 changes: 3 additions & 0 deletions util/imagetools/imagetools.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ func normalizeOsDistribution(osDist string, imageName string) string {
return "Fedora"
} else if strings.Contains(osDist, "alma") {
return "AlmaLinux"
} else if strings.Contains(osDist, "amazon linux") {
return "Amazon Linux"
} else if strings.Contains(osDist, "windows") {
for _, ver := range []string{"2003", "2008", "2012", "2016", "2019", "2022"} {
if strings.Contains(osDist, ver) {
Expand Down Expand Up @@ -144,6 +146,7 @@ var imageVersions = map[string][]string{
"Rocky Linux": {"8.5", "8.6", "8.7", "8.8", "8.9", "9.0", "9.1", "9.2"},
"Fedora": {"33", "34", "35"},
"AlmaLinux": {"8.5"},
"Amazon Linux": {"2023", "2"},

"Windows Server": {"2003", "2008", "2012", "2016", "2019", "2022"},
"Windows": {"XP", "7", "8", "Vista", "10", "11"},
Expand Down
Loading