Skip to content

Commit

Permalink
Merge pull request #126 from ioito/hotfix/qx-uos-dist
Browse files Browse the repository at this point in the history
fix(imagetools): uos dist
  • Loading branch information
ioito authored May 10, 2024
2 parents e4ad08e + f0e59a6 commit 8203b24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/imagetools/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ func TestNormalizeImageInfo(t *testing.T) {
OsLang: "",
OsArch: "x86_64",
},
{
Name: "UOS 20 1050 Hygon 64位",
OsDistro: "UOS",
OsType: osprofile.OS_TYPE_LINUX,
OsVersion: "20 1050",
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 @@ -114,6 +114,8 @@ func normalizeOsDistribution(osDist string, imageName string) string {
return "Amazon Linux"
} else if strings.Contains(osDist, "kylin") {
return "Kylin"
} else if strings.Contains(osDist, "uos") {
return "UOS"
} 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 @@ -154,6 +156,7 @@ var imageVersions = map[string][]string{
"Windows": {"XP", "7", "8", "Vista", "10", "11"},

"Kylin": {"V10"},
"UOS": {"V20", "20 1050", "1050", "1060", "1070"},
}

func normalizeOsVersion(imageName string, osDist string, osVersion string) string {
Expand Down

0 comments on commit 8203b24

Please # to comment.