fix: update vendor for v4.0.3 (#24761)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2026-05-03 23:22:56 +08:00
committed by GitHub
parent 71648a8e02
commit f998448ad1
7 changed files with 68 additions and 28 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ dep:
@echo "$$depDeprecated"
@$(MAKE) mod
RELEASE_BRANCH:=release/4.0
RELEASE_BRANCH:=release/4.0.3
GOPROXY ?= direct
mod:
+2 -2
View File
@@ -108,12 +108,12 @@ require (
k8s.io/cri-api v0.28.15
k8s.io/klog/v2 v2.90.1
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260416100248-1e78d55e2b71
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260422030642-84e9ebcd4edc
yunion.io/x/executor v0.0.0-20260312022053-f538abd2b005
yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1
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.4-0.20260224071200-5c269fa62429
yunion.io/x/pkg v1.10.4-0.20260422030155-01b100134978
yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1
yunion.io/x/sqlchemy v1.1.3-0.20251231025938-b0a38f6e9fab
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
+4 -4
View File
@@ -1783,8 +1783,8 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260416100248-1e78d55e2b71 h1:ObA2AVgIvicxhlQFsW6vrmWKAqTIV9FDpxrpKU0E538=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260416100248-1e78d55e2b71/go.mod h1:rCz5Nds6Zi/5uaj51oRDYdj5fZ5uULmKbuBAgNLuI+w=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260422030642-84e9ebcd4edc h1:WEwV9QBvFzOZhvJbpcRYzgA1jAHnzq3IB2qhs+eECIc=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260422030642-84e9ebcd4edc/go.mod h1:rCz5Nds6Zi/5uaj51oRDYdj5fZ5uULmKbuBAgNLuI+w=
yunion.io/x/executor v0.0.0-20260312022053-f538abd2b005 h1:3sWwcjGXGjG9mLBWa7AyLq+QSi0udTAx21pfVQRFMBE=
yunion.io/x/executor v0.0.0-20260312022053-f538abd2b005/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws=
yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634=
@@ -1798,8 +1798,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.4-0.20260224071200-5c269fa62429 h1:yskc2HFnBZXEzfYeQBFdL2gXzVfdPQ8yT4qVDyuhajM=
yunion.io/x/pkg v1.10.4-0.20260224071200-5c269fa62429/go.mod h1:0Bwxqd9MA3ACi119/l02FprY/o9gHahmYC2bsSbnVpM=
yunion.io/x/pkg v1.10.4-0.20260422030155-01b100134978 h1:+BS9DValwi0xHa92xrB+RR6Cxp7bDbXVysa/KiC18rY=
yunion.io/x/pkg v1.10.4-0.20260422030155-01b100134978/go.mod h1:0Bwxqd9MA3ACi119/l02FprY/o9gHahmYC2bsSbnVpM=
yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1 h1:1KJ3YYinydPHpDEQRXdr/T8SYcKZ5Er+m489H+PnaQ4=
yunion.io/x/s3cli v0.0.0-20241221171442-1c11599d28e1/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
yunion.io/x/sqlchemy v1.1.3-0.20251231025938-b0a38f6e9fab h1:5m/bSzW3uTAk83rp9eethbYsxJFYInFVeU1RDkteW4E=
+2 -2
View File
@@ -2598,7 +2598,7 @@ sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.3.0
## explicit; go 1.12
sigs.k8s.io/yaml
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260416100248-1e78d55e2b71
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260422030642-84e9ebcd4edc
## explicit; go 1.24
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
@@ -2710,7 +2710,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.4-0.20260224071200-5c269fa62429
# yunion.io/x/pkg v1.10.4-0.20260422030155-01b100134978
## explicit; go 1.18
yunion.io/x/pkg/appctx
yunion.io/x/pkg/errors
+1 -1
View File
@@ -62,7 +62,7 @@ func (self *SStoragecache) IsEmulated() bool {
}
func (self *SStoragecache) GetICustomizedCloudImages() ([]cloudprovider.ICloudImage, error) {
images, err := self.region.GetImages("", ImageOwnerSelf, nil, "", "hvm", nil, "", true)
images, err := self.region.GetImages("", ImageOwnerSelf, nil, "", "hvm", nil, "", false)
if err != nil {
return nil, errors.Wrapf(err, "GetImages")
}
+41 -8
View File
@@ -17,11 +17,14 @@ package compare
import (
"fmt"
"strings"
"sync"
"yunion.io/x/pkg/errors"
)
type SyncResult struct {
mu sync.Mutex `json:"-"`
AddCnt int `json:"add_cnt,omitzero"`
AddErrCnt int `json:"add_err_cnt,omitzero"`
UpdateCnt int `json:"update_cnt,omitzero"`
@@ -31,41 +34,59 @@ type SyncResult struct {
errors []error
}
func (self *SyncResult) Error(msg error) {
func (self *SyncResult) appendError(msg error) {
if self.errors == nil {
self.errors = make([]error, 0)
}
self.errors = append(self.errors, msg)
}
func (self *SyncResult) Error(msg error) {
self.mu.Lock()
defer self.mu.Unlock()
self.appendError(msg)
}
func (self *SyncResult) Add() {
self.mu.Lock()
defer self.mu.Unlock()
self.AddCnt += 1
}
func (self *SyncResult) AddError(msg error) {
self.mu.Lock()
defer self.mu.Unlock()
self.AddErrCnt += 1
self.Error(msg)
self.appendError(msg)
}
func (self *SyncResult) Update() {
self.mu.Lock()
defer self.mu.Unlock()
self.UpdateCnt += 1
}
func (self *SyncResult) UpdateError(msg error) {
self.mu.Lock()
defer self.mu.Unlock()
self.UpdateErrCnt += 1
self.Error(msg)
self.appendError(msg)
}
func (self *SyncResult) Delete() {
self.mu.Lock()
defer self.mu.Unlock()
self.DelCnt += 1
}
func (self *SyncResult) DeleteError(msg error) {
self.mu.Lock()
defer self.mu.Unlock()
self.DelErrCnt += 1
self.Error(msg)
self.appendError(msg)
}
func (self *SyncResult) AllError() error {
func (self *SyncResult) allErrorUnlocked() error {
msgs := make(map[string]bool)
for _, e := range self.errors {
msg := e.Error()
@@ -80,11 +101,21 @@ func (self *SyncResult) AllError() error {
return fmt.Errorf(strings.Join(ret, ";"))
}
func (self *SyncResult) AllError() error {
self.mu.Lock()
defer self.mu.Unlock()
return self.allErrorUnlocked()
}
func (self *SyncResult) IsError() bool {
return self.errors != nil && len(self.errors) > 0
self.mu.Lock()
defer self.mu.Unlock()
return len(self.errors) > 0
}
func (self *SyncResult) IsGenerateError() bool {
self.mu.Lock()
defer self.mu.Unlock()
for _, err := range self.errors {
if e := errors.Cause(err); e != errors.ErrNotImplemented && e != errors.ErrNotSupported && e != errors.ErrNotEmpty {
return true
@@ -94,9 +125,11 @@ func (self *SyncResult) IsGenerateError() bool {
}
func (self *SyncResult) Result() string {
self.mu.Lock()
defer self.mu.Unlock()
msg := fmt.Sprintf("removed %d failed %d updated %d failed %d added %d failed %d", self.DelCnt, self.DelErrCnt, self.UpdateCnt, self.UpdateErrCnt, self.AddCnt, self.AddErrCnt)
if self.IsError() {
msg = fmt.Sprintf("%s;%s", msg, self.AllError())
if len(self.errors) > 0 {
msg = fmt.Sprintf("%s;%s", msg, self.allErrorUnlocked())
}
return msg
}
+17 -10
View File
@@ -156,7 +156,7 @@ func normalizeOsDistribution(osDist string, imageName string) string {
return OS_DIST_KYLIN
} else if strings.Contains(osDist, "uos") {
return OS_DIST_UOS
} else if strings.Contains(osDist, "windows") || regexp.MustCompile(".+win(xp|7|8|10|11|2003|2008|2012|2016|2019|2022)*").MatchString(osDist) {
} else if strings.Contains(osDist, "windows") || regexp.MustCompile("(^|[^a-z0-9])win(xp|7|8|10|11|2003|2008|2012|2016|2019|2022)([^a-z0-9]|$)").MatchString(osDist) {
for _, ver := range []string{"2003", "2008", "2012", "2016", "2019", "2022"} {
if strings.Contains(osDist, ver) {
return OS_DIST_WINDOWS_SERVER
@@ -197,18 +197,18 @@ var imageVersions = map[string][]string{
OS_DIST_OPEN_EULER: {"2.0 SP1", "2.0 SP2", "2.0 SP3", "2.0 SP8", "3.0", "22.03", "23.09"},
OS_DIST_EULER_OS: {"2"},
// 阿里云Linux:补充1代和2/3代版本
OS_DIST_ALIYUN: {"1", "2.1903", "3.2104", "3.2304"},
OS_DIST_ALIYUN: {"1", "2.1903", "2", "3.2104", "3.2304", "3"},
// 阿里云轻量版:补充完整版本
OS_DIST_ALIBABA_CLOUD_LINUX: {"2.1903", "3.2104", "3.2304", "3.2404"},
OS_DIST_ALIBABA_CLOUD_LINUX: {"2.1903", "2", "3.2104", "3.2304", "3.2404", "3"},
// 龙蜥OS:补充7/8系列完整小版本
OS_DIST_ANOLIS: {"7.6", "7.9", "8.2", "8.4", "8.6", "8.8", "9.0", "9.2"},
OS_DIST_ANOLIS: {"7.6", "7.9", "7", "8.2", "8.4", "8.6", "8.8", "8", "9.0", "9.2", "9"},
// Rocky Linux:补充8/9全系列小版本
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", "9.5"},
OS_DIST_ROCKY_LINUX: {"8.5", "8.6", "8.7", "8.8", "8.9", "8.10", "8", "9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9"},
// Fedora:补充近年主流版本(33到40)
OS_DIST_FEDORA: {"33", "34", "35", "36", "37", "38", "39", "40"},
// AlmaLinux:补充8/9全系列
OS_DIST_ALMA_LINUX: {"8.5", "8.6", "8.7", "8.8", "8.9", "8.10", "9.0", "9.1", "9.2", "9.3", "9.4", "9.5"},
OS_DIST_ALMA_LINUX: {"8.5", "8.6", "8.7", "8.8", "8.9", "8.10", "8", "9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9"},
// Amazon Linux:补充1/2/2023版本
OS_DIST_AMAZON_LINUX: {"2022", "2023", "1", "2"},
@@ -242,7 +242,7 @@ func normalizeOsVersion(imageName string, osDist string, osVersion string) strin
parts = append(parts, fmt.Sprintf(`(?P<verstr>%s[.\d]*)`, version), "")
regexpStr := strings.Join(parts, `[\s-_]*`)
m := regexp.MustCompile(regexpStr).FindAllStringSubmatch(strings.ToLower(imageName), -1)
if m != nil && len(m) > 0 && len(m[0]) > 1 {
if len(m) > 0 && len(m[0]) > 1 {
verStr := m[0][1]
if strings.HasPrefix(verStr, version) && len(verStr) > len(version) && !strings.HasPrefix(verStr, version+".") {
verStr = version + "." + verStr[len(version):]
@@ -251,11 +251,18 @@ func normalizeOsVersion(imageName string, osDist string, osVersion string) strin
}
}
}
for i := len(versions) - 1; i > 0; i-- {
if strings.Contains(imageName, versions[i]) {
return versions[i]
imageNameLower := strings.ToLower(imageName)
bestMatch := ""
for i := 0; i < len(versions); i++ {
version := strings.ToLower(versions[i])
pattern := fmt.Sprintf(`(^|[^0-9])%s([^0-9]|$)`, regexp.QuoteMeta(version))
if regexp.MustCompile(pattern).MatchString(imageNameLower) && len(versions[i]) > len(bestMatch) {
bestMatch = versions[i]
}
}
if len(bestMatch) > 0 {
return bestMatch
}
}
return ""
}