From f0e59a60618a07a67095809d3243b745db6008a3 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Fri, 10 May 2024 11:03:12 +0800 Subject: [PATCH] fix(imagetools): uos dist --- util/imagetools/image_test.go | 8 ++++++++ util/imagetools/imagetools.go | 3 +++ 2 files changed, 11 insertions(+) diff --git a/util/imagetools/image_test.go b/util/imagetools/image_test.go index 6da619d..8ab655d 100644 --- a/util/imagetools/image_test.go +++ b/util/imagetools/image_test.go @@ -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 { diff --git a/util/imagetools/imagetools.go b/util/imagetools/imagetools.go index e5ae930..97e6c5d 100644 --- a/util/imagetools/imagetools.go +++ b/util/imagetools/imagetools.go @@ -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) { @@ -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 {