Skip to content

Commit

Permalink
Merge pull request #119 from ioito/hotfix/qx-amazon-linux
Browse files Browse the repository at this point in the history
fix: add amazon linux
  • Loading branch information
ioito authored Apr 9, 2024
2 parents 3b5e612 + 9769ffa commit 7c75358
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
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

0 comments on commit 7c75358

Please # to comment.