From 25b5de68ff17d51436088c9863b43997a298ca48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Sun, 7 Dec 2025 16:01:08 +0800 Subject: [PATCH] fix(region): vendor update (#23903) --- go.mod | 4 +- go.sum | 4 +- pkg/compute/guestdrivers/baidu.go | 24 ++++++------ vendor/modules.txt | 2 +- .../x/cloudmux/pkg/multicloud/baidu/baidu.go | 38 ++++++++++++++++--- .../x/cloudmux/pkg/multicloud/baidu/bucket.go | 12 ++++++ 6 files changed, 62 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 7eb8c70154..7762b4b9b4 100644 --- a/go.mod +++ b/go.mod @@ -27,6 +27,7 @@ require ( github.com/go-yaml/yaml v2.1.0+incompatible github.com/golang-plus/uuid v1.0.0 github.com/golang/mock v1.4.4 + github.com/golang/protobuf v1.5.4 github.com/google/cadvisor v0.38.5 github.com/google/gopacket v1.1.17 github.com/google/uuid v1.6.0 @@ -98,7 +99,7 @@ require ( k8s.io/cri-api v0.28.15 k8s.io/klog/v2 v2.20.0 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251202110347-66e60ae88e4f + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251205085757-3dc9b243b5c2 yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1 yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 @@ -233,7 +234,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-plus/errors v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/google/go-querystring v1.0.0 // indirect diff --git a/go.sum b/go.sum index 7ba0a9679e..9ccce2737c 100644 --- a/go.sum +++ b/go.sum @@ -1661,8 +1661,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.20251202110347-66e60ae88e4f h1:XbF3dPkwrLs9ndX8QP23EGFljbnkII76UjPDKeIJvhA= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251202110347-66e60ae88e4f/go.mod h1:aWRX5Phwz3nbHUNnIAm1oVogjguXPYDDgCOy/9Hnnvk= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251205085757-3dc9b243b5c2 h1:Im0mZviWDEU5EN1fPoWJwcrGb6u9OxY7oqyYE0PLlHg= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251205085757-3dc9b243b5c2/go.mod h1:aWRX5Phwz3nbHUNnIAm1oVogjguXPYDDgCOy/9Hnnvk= yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0 h1:msG4SiDSVU7CrXH06WuHlNEZXIooTcmNbfrIGHuIHBU= yunion.io/x/executor v0.0.0-20250518005516-5402e9e0bed0/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= diff --git a/pkg/compute/guestdrivers/baidu.go b/pkg/compute/guestdrivers/baidu.go index 55473ce1fa..ec2c4648ff 100644 --- a/pkg/compute/guestdrivers/baidu.go +++ b/pkg/compute/guestdrivers/baidu.go @@ -94,20 +94,20 @@ func (self *SBaiduGuestDriver) GetInstanceCapability() cloudprovider.SInstanceCa }, Storages: cloudprovider.Storage{ DataDisk: []cloudprovider.StorageInfo{ - {StorageType: api.STORAGE_BAIDU_SSD, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_PREMIUM_SSD, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_HDD, MaxSizeGb: 32765, MinSizeGb: 5, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL1, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL2, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL3, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_SSD, MaxSizeGb: 65536, MinSizeGb: 5, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_PREMIUM_SSD, MaxSizeGb: 65536, MinSizeGb: 20, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_HDD, MaxSizeGb: 65536, MinSizeGb: 5, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL1, MaxSizeGb: 65536, MinSizeGb: 5, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL2, MaxSizeGb: 65536, MinSizeGb: 461, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL3, MaxSizeGb: 65536, MinSizeGb: 1261, StepSizeGb: 1, Resizable: true}, }, SysDisk: []cloudprovider.StorageInfo{ - {StorageType: api.STORAGE_BAIDU_SSD, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_PREMIUM_SSD, MaxSizeGb: 32765, MinSizeGb: 20, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_HDD, MaxSizeGb: 32765, MinSizeGb: 20, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL1, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL2, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, - {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL3, MaxSizeGb: 32765, MinSizeGb: 50, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_SSD, MaxSizeGb: 20480, MinSizeGb: 10, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_PREMIUM_SSD, MaxSizeGb: 20480, MinSizeGb: 10, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_HDD, MaxSizeGb: 20480, MinSizeGb: 10, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL1, MaxSizeGb: 20480, MinSizeGb: 20, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL2, MaxSizeGb: 20480, MinSizeGb: 461, StepSizeGb: 1, Resizable: true}, + {StorageType: api.STORAGE_BAIDU_ENHANCED_SSD_PL3, MaxSizeGb: 20480, MinSizeGb: 1261, StepSizeGb: 1, Resizable: true}, }, }, } diff --git a/vendor/modules.txt b/vendor/modules.txt index 0e292e3a6d..12323394c0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2243,7 +2243,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.20251202110347-66e60ae88e4f +# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251205085757-3dc9b243b5c2 ## explicit; go 1.24 yunion.io/x/cloudmux/pkg/apis yunion.io/x/cloudmux/pkg/apis/billing diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/baidu.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/baidu.go index 7cf167151d..4b80382f7d 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/baidu.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/baidu.go @@ -178,7 +178,13 @@ func (cli *SBaiduClient) bosList(regionId, bucketName, resource string, params u return nil, err } _, ret, err := httputils.ParseJSONResponse("", resp, err, cli.debug) - return ret, err + if err != nil { + return nil, errors.Wrapf(err, "ParseJSONResponse") + } + if gotypes.IsNil(ret) { + return jsonutils.NewDict(), nil + } + return ret, nil } func (cli *SBaiduClient) bosDelete(regionId, bucketName, resource string, params url.Values) (jsonutils.JSONObject, error) { @@ -187,7 +193,13 @@ func (cli *SBaiduClient) bosDelete(regionId, bucketName, resource string, params return nil, err } _, ret, err := httputils.ParseJSONResponse("", resp, err, cli.debug) - return ret, err + if err != nil { + return nil, errors.Wrapf(err, "ParseJSONResponse") + } + if gotypes.IsNil(ret) { + return jsonutils.NewDict(), nil + } + return ret, nil } func (cli *SBaiduClient) bosUpdate(regionId, bucketName, resource string, params url.Values, body map[string]interface{}) (jsonutils.JSONObject, error) { @@ -200,7 +212,13 @@ func (cli *SBaiduClient) bosUpdate(regionId, bucketName, resource string, params return nil, err } _, ret, err := httputils.ParseJSONResponse("", resp, err, cli.debug) - return ret, err + if err != nil { + return nil, errors.Wrapf(err, "ParseJSONResponse") + } + if gotypes.IsNil(ret) { + return jsonutils.NewDict(), nil + } + return ret, nil } func (cli *SBaiduClient) bosRequest(method httputils.THttpMethod, regionId, bucketName, resource string, params url.Values, header http.Header, body io.Reader) (*http.Response, error) { @@ -271,7 +289,13 @@ func (cli *SBaiduClient) request(method httputils.THttpMethod, service, regionId return nil, err } _, ret, err := httputils.ParseJSONResponse("", resp, err, cli.debug) - return ret, err + if err != nil { + return nil, errors.Wrapf(err, "ParseJSONResponse") + } + if gotypes.IsNil(ret) { + return jsonutils.NewDict(), nil + } + return ret, nil } func (cli *SBaiduClient) raw_request(method httputils.THttpMethod, service, regionId, bucketName, resource string, params url.Values, header http.Header, body io.Reader) (*http.Response, error) { @@ -302,7 +326,11 @@ func (cli *SBaiduClient) raw_request(method httputils.THttpMethod, service, regi } header.Set("Authorization", signature) - return httputils.Request(cli.getDefaultClient(), cli.ctx, method, uri, header, body, cli.debug) + resp, err := httputils.Request(cli.getDefaultClient(), cli.ctx, method, uri, header, body, cli.debug) + if err != nil { + return nil, err + } + return resp, nil } func (cli *SBaiduClient) GetSubAccounts() ([]cloudprovider.SSubAccount, error) { diff --git a/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/bucket.go b/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/bucket.go index 292cda8e56..fe8b11bce7 100644 --- a/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/bucket.go +++ b/vendor/yunion.io/x/cloudmux/pkg/multicloud/baidu/bucket.go @@ -28,6 +28,7 @@ import ( "yunion.io/x/cloudmux/pkg/multicloud" "yunion.io/x/jsonutils" "yunion.io/x/pkg/errors" + "yunion.io/x/pkg/gotypes" "yunion.io/x/pkg/util/httputils" ) @@ -103,6 +104,9 @@ func (b *SBucket) GetTags() (map[string]string, error) { if err != nil { return nil, errors.Wrap(err, "ParseJSONResponse") } + if gotypes.IsNil(body) { + return nil, nil + } ret := struct { Tag []struct { TagKey string `json:"tagKey"` @@ -313,6 +317,9 @@ func (b *SBucket) NewMultipartUpload(ctx context.Context, key string, cannedAcl if err != nil { return "", errors.Wrapf(err, "ParseJSONResponse %s %s", b.Name, key) } + if gotypes.IsNil(body) { + return "", errors.Errorf("empty response for NewMultipartUpload %s %s", b.Name, key) + } return body.GetString("uploadId") } @@ -381,6 +388,11 @@ func (b *SBucket) CopyPart(ctx context.Context, key string, uploadId string, par if err != nil { return "", errors.Wrapf(err, "ParseJSONResponse %s %s %s", b.Name, key, uploadId) } + + if gotypes.IsNil(body) { + return "", errors.Errorf("empty response for CopyPart %s %s %s %s %d %d", b.Name, key, uploadId, srcBucket, srcOffset, srcLength) + } + return body.GetString("eTag") }