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(imagetools): uos dist #126

Merged
merged 1 commit into from
May 10, 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
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
Loading