fix(region): vendor update (#18815)

This commit is contained in:
屈轩
2023-11-29 15:00:41 +08:00
committed by GitHub
parent 0b8c6a0255
commit 8472fe65b6
13 changed files with 31 additions and 47 deletions
+2 -2
View File
@@ -86,14 +86,14 @@ require (
k8s.io/client-go v0.19.3
k8s.io/cluster-bootstrap v0.19.3
moul.io/http2curl/v2 v2.3.0
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231120065018-41aec345dfbe
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231129040310-700e5400905b
yunion.io/x/executor v0.0.0-20230705125604-c5ac3141db32
yunion.io/x/jsonutils v1.0.1-0.20230613121553-0f3b41e2ef19
yunion.io/x/log v1.0.1-0.20230411060016-feb3f46ab361
yunion.io/x/ovsdb v0.0.0-20230306173834-f164f413a900
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926
yunion.io/x/sqlchemy v1.1.2-0.20231128175927-6f5f8a9858dc
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c
)
+4 -4
View File
@@ -1192,8 +1192,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.20231120065018-41aec345dfbe h1:RnSxzytd/yWsF6w75vLfJi+osjOJIpkxHL46iTsw0DE=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231120065018-41aec345dfbe/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231129040310-700e5400905b h1:qqYTumHwnSrJqYZTtQHK02LhChC8CGUuJlGvISxKBts=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231129040310-700e5400905b/go.mod h1:aj1gR9PPb6eqqKOwvANe26CoZFY8ydmXy0fuvgKYXH0=
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=
@@ -1211,7 +1211,7 @@ yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142 h1:L6LqxfP08eWUx+A6yQdrL6VB
yunion.io/x/pkg v1.0.1-0.20231101105448-abef64cdc142/go.mod h1:ksCJVQ+DwKrJ5QBEoU8pzrDFfDaZVAFH/iJ6yQCYxJk=
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.2-0.20231017172907-561e7f013926 h1:FJ+2J0MwmxUcuN/8ukWHdK2XIoV3GGCotTCgi0w4L+w=
yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/sqlchemy v1.1.2-0.20231128175927-6f5f8a9858dc h1:Q+uZD4rGqmu9CXBF6iwIn98NEGpDAtReEzxljM2lhb8=
yunion.io/x/sqlchemy v1.1.2-0.20231128175927-6f5f8a9858dc/go.mod h1:uuPVZEyEq3sWd5vf9VjGSy6lZzof22X87OEHw9sddJQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c h1:QuLab2kSRECZRxo4Lo2KcYn6XjQFDGaZ1+x0pYDVVwQ=
yunion.io/x/structarg v0.0.0-20231017124457-df4d5009457c/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
+2 -2
View File
@@ -1458,7 +1458,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.20231120065018-41aec345dfbe
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231129040310-700e5400905b
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
@@ -1616,7 +1616,7 @@ yunion.io/x/pkg/utils
# yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
## explicit; go 1.12
yunion.io/x/s3cli
# yunion.io/x/sqlchemy v1.1.2-0.20231017172907-561e7f013926
# yunion.io/x/sqlchemy v1.1.2-0.20231128175927-6f5f8a9858dc
## explicit; go 1.17
yunion.io/x/sqlchemy
yunion.io/x/sqlchemy/backends
+1 -1
View File
@@ -408,7 +408,7 @@ func (region *SRegion) GetIDBInstances() ([]cloudprovider.ICloudDBInstance, erro
return nil, err
}
instances = append(instances, part...)
if len(instances) >= total {
if len(instances) >= total || len(part) == 0 {
break
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ func (self *SHost) GetIVMs() ([]cloudprovider.ICloudVM, error) {
return nil, err
}
vms = append(vms, parts...)
if len(vms) >= total {
if len(vms) >= total || len(parts) == 0 {
break
}
}
+5 -2
View File
@@ -322,7 +322,7 @@ func (self *SRegion) fetchIVpcs() error {
return err
}
vpcs = append(vpcs, part...)
if len(vpcs) >= total {
if len(vpcs) >= total || len(part) == 0 {
break
}
}
@@ -711,6 +711,9 @@ func (self *SRegion) GetIEips() ([]cloudprovider.ICloudEIP, error) {
return nil, err
}
eips = append(eips, parts...)
if len(parts) == 0 {
break
}
}
ret := make([]cloudprovider.ICloudEIP, len(eips))
for i := 0; i < len(eips); i += 1 {
@@ -1089,7 +1092,7 @@ func (region *SRegion) GetIVMs() ([]cloudprovider.ICloudVM, error) {
return nil, err
}
vms = append(vms, parts...)
if len(vms) >= total {
if len(vms) >= total || len(parts) == 0 {
break
}
}
+1 -1
View File
@@ -79,7 +79,7 @@ func (self *SStorage) getDisks() ([]SDisk, error) {
return nil, errors.Wrapf(err, "GetDisks")
}
self.zone.disks = append(self.zone.disks, part...)
if len(self.zone.disks) >= total {
if len(self.zone.disks) >= total || len(part) == 0 {
break
}
}
+3 -3
View File
@@ -203,7 +203,7 @@ func (self *SVpc) fetchSecurityGroups() error {
return err
}
secgroups = append(secgroups, parts...)
if len(secgroups) >= total {
if len(secgroups) >= total || len(parts) == 0 {
break
}
}
@@ -233,7 +233,7 @@ func (self *SVpc) fetchRouteTables() error {
return err
}
routeTables = append(routeTables, parts...)
if len(routeTables) >= total {
if len(routeTables) >= total || len(parts) == 0 {
break
}
}
@@ -290,7 +290,7 @@ func (self *SVpc) GetINatGateways() ([]cloudprovider.ICloudNatGateway, error) {
return nil, err
}
nats = append(nats, parts...)
if len(nats) >= total {
if len(nats) >= total || len(parts) == 0 {
break
}
}
+1 -3
View File
@@ -111,11 +111,9 @@ func (region *SRegion) GetDiskWithStorage(diskId string) (*SDisk, error) {
}
}
return nil, cloudprovider.ErrNotFound
case StorageTypeCeph:
default:
disk.storage = storage
return disk, nil
default:
return nil, fmt.Errorf("Unsupport StorageType %s", storage.Type)
}
}
+6 -3
View File
@@ -107,9 +107,8 @@ func (host *SHost) GetIStorages() ([]cloudprovider.ICloudStorage, error) {
return nil, err
}
istorages = append(istorages, localStorages...)
case StorageTypeCeph:
default:
istorages = append(istorages, &storages[i])
case StorageTypeVCenter:
}
}
return istorages, nil
@@ -337,7 +336,11 @@ func (region *SRegion) createDataDisks(disks []cloudprovider.SDiskInfo, hostId s
return diskIds, err
}
default:
return diskIds, fmt.Errorf("not support storageType %s", disks[i].StorageType)
disk, err := region.CreateDisk(disks[i].Name, storage.UUID, "", "", disks[i].SizeGB, "")
if err != nil {
return diskIds, err
}
diskIds = append(diskIds, disk.UUID)
}
}
return diskIds, nil
+1 -11
View File
@@ -93,10 +93,9 @@ func (region *SRegion) getIStorages(zondId string) ([]cloudprovider.ICloudStorag
return nil, err
}
istorage = append(istorage, ilocalStorages...)
case StorageTypeCeph:
default:
primaryStorage.region = region
istorage = append(istorage, &primaryStorage)
case StorageTypeVCenter:
}
}
return istorage, nil
@@ -157,10 +156,6 @@ func (storage *SStorage) GetGlobalId() string {
return storage.GetId()
}
func (storage *SStorage) IsEmulated() bool {
return false
}
func (storage *SStorage) GetIZone() cloudprovider.ICloudZone {
zone, err := storage.region.GetZone(storage.ZoneUUID)
if err != nil {
@@ -205,11 +200,6 @@ func (storage *SStorage) GetStorageConf() jsonutils.JSONObject {
return conf
}
func (storage *SStorage) Refresh() error {
// do nothing
return nil
}
func (storage *SStorage) GetEnabled() bool {
return true
}
+1 -1
View File
@@ -168,7 +168,7 @@ func findSegment(sqlStr string, prefix string) string {
func trimPartition(partStr string) string {
for {
partStr = strings.TrimSpace(partStr)
if partStr[0] == '(' {
if len(partStr) > 0 && partStr[0] == '(' {
partStr = partStr[1 : len(partStr)-1]
} else {
break
+3 -13
View File
@@ -164,20 +164,11 @@ func setValueBySQLString(value reflect.Value, val string) error {
if jsonV == jsonutils.JSONNull {
return nil
}
jsonM, err := jsonV.GetMap()
if err != nil {
return errors.Wrapf(err, "jsonV.GetMap val %s json %s", val, jsonV)
}
mapValue := reflect.MakeMap(value.Type())
value.Set(mapValue)
for k, jsonV := range jsonM {
elemValue := reflect.New(value.Type().Elem()).Elem()
jsonStr, _ := jsonV.GetString()
err := setValueBySQLString(elemValue, jsonStr)
if err != nil {
return errors.Wrapf(err, "TestSetValueBySQLString %s", jsonV.String())
}
value.SetMapIndex(reflect.ValueOf(k), elemValue)
err = jsonV.Unmarshal(mapValue.Interface())
if err != nil {
return errors.Wrapf(err, "jsonV.Unmarshal")
}
return nil
default:
@@ -208,7 +199,6 @@ func setValueBySQLString(value reflect.Value, val string) error {
}
value.Set(reflect.Indirect(newVal))
return nil
// return errors.Wrapf(ErrNotSupported, "not supported type: %s", valueType)
}
}
}