mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): vendor update for qcloud tencentos server (#20663)
This commit is contained in:
@@ -89,12 +89,12 @@ require (
|
||||
k8s.io/cluster-bootstrap v0.19.3
|
||||
k8s.io/cri-api v0.22.17
|
||||
moul.io/http2curl/v2 v2.3.0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240625073308-e7f818389af0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240627062632-f586429f366d
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
|
||||
yunion.io/x/jsonutils v1.0.1-0.20240203102553-4096f103b401
|
||||
yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
|
||||
yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47
|
||||
yunion.io/x/pkg v1.10.1-0.20240627035901-5608be5905f9
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240624023332-82a08f917568
|
||||
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
|
||||
|
||||
@@ -1215,8 +1215,8 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
|
||||
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240625073308-e7f818389af0 h1:tHwLq3t3M8JxJ1IPOYarEQQmFy7YB4PVCtmdzn3C/7Q=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240625073308-e7f818389af0/go.mod h1:quoJjGTJ2PjAY0+3YeN5JuN136whECKmfkJQwIsXKjM=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240627062632-f586429f366d h1:FsW649gKCUZOmXbRrD7gDYc9q/Hl19bKaNBe9/BJRCE=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240627062632-f586429f366d/go.mod h1:iLoBHVR2Eur/1WJSGcbZaEwpzh/iqXvbFCsX9/xt8CI=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32 h1:v7POYkQwo1XzOxBoIoRVr/k0V9Y5JyjpshlIFa9raug=
|
||||
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
|
||||
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
|
||||
@@ -1230,8 +1230,8 @@ yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900 h1:Hu/4ERvoWaN6aiFs4h4/yvVB
|
||||
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900/go.mod h1:0vLkNEhlmA64HViPBAnSTUMrx5QP1CLsxXmxDKQ80tc=
|
||||
yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47 h1:uh8OUgdycVKVORSoWNj2w9gMBEaOPgRePSlGqyKYa9s=
|
||||
yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47/go.mod h1:+3nFKJt+O4xWboiDAv2EqvMM0rmm3tPJaOuQSHFkcY8=
|
||||
yunion.io/x/pkg v1.10.1-0.20240627035901-5608be5905f9 h1:eG7+VwaPllfRptUT0Rb+labNGeaLr/rKVgmNuvPzm84=
|
||||
yunion.io/x/pkg v1.10.1-0.20240627035901-5608be5905f9/go.mod h1:+3nFKJt+O4xWboiDAv2EqvMM0rmm3tPJaOuQSHFkcY8=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v1.1.3-0.20240624023332-82a08f917568 h1:Ytz3G6z3/U+yzkM3KM/am1ndPWHB0nDlOLi9OJWduPc=
|
||||
|
||||
Vendored
+2
-2
@@ -1489,7 +1489,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
|
||||
# sigs.k8s.io/yaml v1.2.0
|
||||
## explicit; go 1.12
|
||||
sigs.k8s.io/yaml
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240625073308-e7f818389af0
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20240627062632-f586429f366d
|
||||
## explicit; go 1.18
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
@@ -1586,7 +1586,7 @@ yunion.io/x/log/hooks
|
||||
yunion.io/x/ovsdb/cli_util
|
||||
yunion.io/x/ovsdb/schema/ovn_nb
|
||||
yunion.io/x/ovsdb/types
|
||||
# yunion.io/x/pkg v1.10.1-0.20240601050854-9e3452bf4d47
|
||||
# yunion.io/x/pkg v1.10.1-0.20240627035901-5608be5905f9
|
||||
## explicit; go 1.18
|
||||
yunion.io/x/pkg/appctx
|
||||
yunion.io/x/pkg/errors
|
||||
|
||||
+3
-1
@@ -65,6 +65,8 @@ type SImage struct {
|
||||
ImageSource string // 镜像来源
|
||||
SyncPercent int // 同步百分比
|
||||
IsSupportCloudinit bool // 镜像是否支持cloud-init
|
||||
OsType string
|
||||
OsVersion string
|
||||
}
|
||||
|
||||
func (self *SImage) GetMinRamSizeMb() int {
|
||||
@@ -189,7 +191,7 @@ func (self *SImage) GetSizeByte() int64 {
|
||||
|
||||
func (self *SImage) getNormalizedImageInfo() *imagetools.ImageInfo {
|
||||
if self.imgInfo == nil {
|
||||
imgInfo := imagetools.NormalizeImageInfo(self.OsName, self.Architecture, self.Platform, self.Platform, "")
|
||||
imgInfo := imagetools.NormalizeImageInfo(self.OsName, self.Architecture, self.OsType, self.Platform, self.OsVersion)
|
||||
self.imgInfo = &imgInfo
|
||||
}
|
||||
|
||||
|
||||
+85
-47
@@ -22,6 +22,40 @@ import (
|
||||
"yunion.io/x/pkg/util/osprofile"
|
||||
)
|
||||
|
||||
const (
|
||||
OS_DIST_CENTOS = "CentOS"
|
||||
OS_DIST_CENTOS_STREAM = "CentOS Stream"
|
||||
|
||||
OS_DIST_RHEL = "RHEL"
|
||||
OS_DIST_FREE_BSD = "FreeBSD"
|
||||
|
||||
OS_DIST_UBUNTU_SERVER = "Ubuntu Server"
|
||||
OS_DIST_UBUNTU = "Ubuntu"
|
||||
|
||||
OS_DIST_OPEN_SUSE = "OpenSUSE"
|
||||
OS_DIST_SUSE = "SUSE"
|
||||
OS_DIST_DEBIAN = "Debian"
|
||||
OS_DIST_CORE_OS = "CoreOS"
|
||||
OS_DIST_EULER_OS = "EulerOS"
|
||||
OS_DIST_ALIYUN = "Aliyun"
|
||||
|
||||
OS_DIST_ALIBABA_CLOUD_LINUX = "Alibaba Cloud Linux"
|
||||
OS_DIST_ANOLIS = "Anolis OS"
|
||||
OS_DIST_ROCKY_LINUX = "Rocky Linux"
|
||||
OS_DIST_FEDORA = "Fedora"
|
||||
OS_DIST_ALMA_LINUX = "AlmaLinux"
|
||||
OS_DIST_AMAZON_LINUX = "Amazon Linux"
|
||||
|
||||
OS_DIST_WINDOWS_SERVER = "Windows Server"
|
||||
OS_DIST_WINDOWS = "Windows"
|
||||
|
||||
OS_DIST_KYLIN = "Kylin"
|
||||
OS_DIST_UOS = "UOS"
|
||||
|
||||
OS_DIST_TENCENTOS_SERVER = "TencentOS Server"
|
||||
OS_DIST_OTHER_LINUX = "Others Linux"
|
||||
)
|
||||
|
||||
func normalizeOsArch(osArch string, imageName string) string {
|
||||
if len(osArch) > 0 {
|
||||
switch strings.ToLower(osArch) {
|
||||
@@ -76,87 +110,91 @@ func normalizeOsDistribution(osDist string, imageName string) string {
|
||||
osDist = imageName
|
||||
}
|
||||
osDist = strings.ToLower(osDist)
|
||||
if strings.Contains(osDist, "centos stream") {
|
||||
return "CentOS Stream"
|
||||
if strings.Contains(osDist, "tencentos") {
|
||||
return OS_DIST_TENCENTOS_SERVER
|
||||
} else if strings.Contains(osDist, "centos stream") {
|
||||
return OS_DIST_CENTOS_STREAM
|
||||
} else if strings.Contains(osDist, "centos") {
|
||||
return "CentOS"
|
||||
return OS_DIST_CENTOS
|
||||
} else if strings.Contains(osDist, "redhat") || strings.Contains(osDist, "rhel") {
|
||||
return "RHEL"
|
||||
return OS_DIST_RHEL
|
||||
} else if strings.Contains(osDist, "ubuntu server") {
|
||||
return "Ubuntu Server"
|
||||
return OS_DIST_UBUNTU_SERVER
|
||||
} else if strings.Contains(osDist, "ubuntu") {
|
||||
return "Ubuntu"
|
||||
} else if strings.Contains(osDist, "suse") {
|
||||
return "SUSE"
|
||||
return OS_DIST_UBUNTU
|
||||
} else if strings.Contains(osDist, "opensuse") {
|
||||
return "OpenSUSE"
|
||||
return OS_DIST_OPEN_SUSE
|
||||
} else if strings.Contains(osDist, "suse") {
|
||||
return OS_DIST_SUSE
|
||||
} else if strings.Contains(osDist, "debian") {
|
||||
return "Debian"
|
||||
return OS_DIST_DEBIAN
|
||||
} else if strings.Contains(osDist, "coreos") {
|
||||
return "CoreOS"
|
||||
return OS_DIST_CORE_OS
|
||||
} else if strings.Contains(osDist, "aliyun") {
|
||||
return "Aliyun"
|
||||
return OS_DIST_ALIYUN
|
||||
} else if strings.Contains(osDist, "freebsd") {
|
||||
return "FreeBSD"
|
||||
return OS_DIST_FREE_BSD
|
||||
} else if strings.Contains(osDist, "euleros") {
|
||||
return "EulerOS"
|
||||
return OS_DIST_EULER_OS
|
||||
} else if strings.Contains(osDist, "alibaba cloud linux") {
|
||||
return "Alibaba Cloud Linux"
|
||||
return OS_DIST_ALIBABA_CLOUD_LINUX
|
||||
} else if strings.Contains(osDist, "anolis") {
|
||||
return "Anolis OS"
|
||||
return OS_DIST_ANOLIS
|
||||
} else if strings.Contains(osDist, "rocky") {
|
||||
return "Rocky Linux"
|
||||
return OS_DIST_ROCKY_LINUX
|
||||
} else if strings.Contains(osDist, "fedora") {
|
||||
return "Fedora"
|
||||
return OS_DIST_FEDORA
|
||||
} else if strings.Contains(osDist, "alma") {
|
||||
return "AlmaLinux"
|
||||
return OS_DIST_ALMA_LINUX
|
||||
} else if strings.Contains(osDist, "amazon") && strings.Contains(osDist, "linux") {
|
||||
return "Amazon Linux"
|
||||
return OS_DIST_AMAZON_LINUX
|
||||
} else if strings.Contains(osDist, "kylin") {
|
||||
return "Kylin"
|
||||
return OS_DIST_KYLIN
|
||||
} else if strings.Contains(osDist, "uos") {
|
||||
return "UOS"
|
||||
return OS_DIST_UOS
|
||||
} else if strings.Contains(osDist, "windows") {
|
||||
for _, ver := range []string{"2003", "2008", "2012", "2016", "2019", "2022"} {
|
||||
if strings.Contains(osDist, ver) {
|
||||
return "Windows Server"
|
||||
return OS_DIST_WINDOWS_SERVER
|
||||
}
|
||||
}
|
||||
return "Windows"
|
||||
return OS_DIST_WINDOWS
|
||||
} else {
|
||||
return "Others Linux"
|
||||
return OS_DIST_OTHER_LINUX
|
||||
}
|
||||
}
|
||||
|
||||
var imageVersions = map[string][]string{
|
||||
"CentOS": {"5", "6", "7", "8"},
|
||||
"CentOS Stream": {"8", "9"},
|
||||
OS_DIST_CENTOS: {"5", "6", "7", "8"},
|
||||
OS_DIST_CENTOS_STREAM: {"8", "9"},
|
||||
|
||||
"RHEL": {"5", "6", "7", "8", "9"},
|
||||
"FreeBSD": {"10", "11", "12"},
|
||||
OS_DIST_RHEL: {"5", "6", "7", "8", "9"},
|
||||
OS_DIST_FREE_BSD: {"10", "11", "12"},
|
||||
|
||||
"Ubuntu Server": {"10", "12", "14", "16", "18", "20", "22"},
|
||||
"Ubuntu": {"10", "12", "14", "16", "17", "18", "19", "20", "21", "22"},
|
||||
OS_DIST_UBUNTU_SERVER: {"10", "12", "14", "16", "18", "20", "22"},
|
||||
OS_DIST_UBUNTU: {"10", "12", "14", "16", "17", "18", "19", "20", "21", "22"},
|
||||
|
||||
"OpenSUSE": {"11", "12"},
|
||||
"SUSE": {"10", "11", "12", "13"},
|
||||
"Debian": {"6", "7", "8", "9", "10", "11"},
|
||||
"CoreOS": {"7"},
|
||||
"EulerOS": {"2"},
|
||||
"Aliyun": {},
|
||||
OS_DIST_OPEN_SUSE: {"11", "12"},
|
||||
OS_DIST_SUSE: {"10", "11", "12", "13"},
|
||||
OS_DIST_DEBIAN: {"6", "7", "8", "9", "10", "11"},
|
||||
OS_DIST_CORE_OS: {"7"},
|
||||
OS_DIST_EULER_OS: {"2"},
|
||||
OS_DIST_ALIYUN: {},
|
||||
|
||||
"Alibaba Cloud Linux": {"2.1903", "3.2104"},
|
||||
"Anolis OS": {"7.9", "8.2", "8.4"},
|
||||
"Rocky Linux": {"8.5", "8.6", "8.7", "8.8", "8.9", "8.10", "9.0", "9.1", "9.2", "9.3", "9.4"},
|
||||
"Fedora": {"33", "34", "35"},
|
||||
"AlmaLinux": {"8.5"},
|
||||
"Amazon Linux": {"2023", "2"},
|
||||
OS_DIST_ALIBABA_CLOUD_LINUX: {"2.1903", "3.2104"},
|
||||
OS_DIST_ANOLIS: {"7.9", "8.2", "8.4"},
|
||||
OS_DIST_ROCKY_LINUX: {"8.5", "8.6", "8.7", "8.8", "8.9", "8.10", "9.0", "9.1", "9.2", "9.3", "9.4"},
|
||||
OS_DIST_FEDORA: {"33", "34", "35"},
|
||||
OS_DIST_ALMA_LINUX: {"8.5"},
|
||||
OS_DIST_AMAZON_LINUX: {"2023", "2"},
|
||||
|
||||
"Windows Server": {"2003", "2008", "2012", "2016", "2019", "2022"},
|
||||
"Windows": {"XP", "7", "8", "Vista", "10", "11"},
|
||||
OS_DIST_WINDOWS_SERVER: {"2003", "2008", "2012", "2016", "2019", "2022"},
|
||||
OS_DIST_WINDOWS: {"XP", "7", "8", "Vista", "10", "11"},
|
||||
|
||||
"Kylin": {"V10"},
|
||||
"UOS": {"V20", "20 1050", "1050", "1060", "1070"},
|
||||
OS_DIST_KYLIN: {"V10"},
|
||||
OS_DIST_UOS: {"V20", "20 1050", "1050", "1060", "1070"},
|
||||
|
||||
OS_DIST_TENCENTOS_SERVER: {"2.4", "3.1"},
|
||||
}
|
||||
|
||||
func normalizeOsVersion(imageName string, osDist string, osVersion string) string {
|
||||
|
||||
Reference in New Issue
Block a user