fix(region): vendor update (#18428)

This commit is contained in:
屈轩
2023-10-25 19:24:32 +08:00
committed by GitHub
parent d728a2bef3
commit 5cd628517a
5 changed files with 36 additions and 12 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ 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.20231025100130-8c9943d8b3f3
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231025105622-cf5e0c639c66
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
+2 -2
View File
@@ -1179,8 +1179,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.20231025100130-8c9943d8b3f3 h1:MAxOjOujD0ggie96x7QyrDWR6hIasiiusAC2QP5lOkY=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231025100130-8c9943d8b3f3/go.mod h1:McRjoG2gaOUisB+Qa41kLCNZhr0lsCu4apEjTiphXVY=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231025105622-cf5e0c639c66 h1:DEC+eK0UYuuNbql/ugyrszLsUy88ItnLcrSo+5uJZE8=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231025105622-cf5e0c639c66/go.mod h1:McRjoG2gaOUisB+Qa41kLCNZhr0lsCu4apEjTiphXVY=
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=
+1 -1
View File
@@ -168,7 +168,7 @@ func (self *SAliyunGuestDriver) ValidateCreateData(ctx context.Context, userCred
}
func (self *SAliyunGuestDriver) GetGuestInitialStateAfterCreate() string {
return api.VM_READY
return api.VM_RUNNING
}
func (self *SAliyunGuestDriver) GetGuestInitialStateAfterRebuild() string {
+1 -1
View File
@@ -1438,7 +1438,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.20231025100130-8c9943d8b3f3
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20231025105622-cf5e0c639c66
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
+31 -7
View File
@@ -580,10 +580,9 @@ func (self *SRegion) CreateInstance(name, hostname string, imageId string, insta
}
params["Description"] = desc
params["InternetChargeType"] = "PayByTraffic"
params["InternetMaxBandwidthIn"] = "200"
params["InternetMaxBandwidthOut"] = "100"
if publicIp.PublicIpBw > 0 {
params["InternetMaxBandwidthOut"] = fmt.Sprintf("%d", publicIp.PublicIpBw)
params["InternetMaxBandwidthIn"] = "200"
}
if publicIp.PublicIpChargeType == cloudprovider.ElasticipChargeTypeByBandwidth {
params["InternetChargeType"] = "PayByBandwidth"
@@ -614,6 +613,9 @@ func (self *SRegion) CreateInstance(name, hostname string, imageId string, insta
params["SystemDisk.Category"] = api.STORAGE_CLOUD_ESSD
params["SystemDisk.PerformanceLevel"] = "PL3"
}
if d.Category == api.STORAGE_CLOUD_AUTO {
params["SystemDisk.BurstingEnabled"] = "true"
}
params["SystemDisk.Size"] = fmt.Sprintf("%d", d.Size)
params["SystemDisk.DiskName"] = d.GetName()
params["SystemDisk.Description"] = d.Description
@@ -632,6 +634,9 @@ func (self *SRegion) CreateInstance(name, hostname string, imageId string, insta
params[fmt.Sprintf("DataDisk.%d.Category", i)] = api.STORAGE_CLOUD_ESSD
params[fmt.Sprintf("DataDisk.%d..PerformanceLevel", i)] = "PL3"
}
if d.Category == api.STORAGE_CLOUD_AUTO {
params[fmt.Sprintf("DataDisk.%d.BurstingEnabled", i)] = "true"
}
params[fmt.Sprintf("DataDisk.%d.DiskName", i)] = d.GetName()
params[fmt.Sprintf("DataDisk.%d.Description", i)] = d.Description
params[fmt.Sprintf("DataDisk.%d.Encrypted", i)] = "false"
@@ -676,13 +681,32 @@ func (self *SRegion) CreateInstance(name, hostname string, imageId string, insta
params["ClientToken"] = utils.GenRequestId(20)
body, err := self.ecsRequest("CreateInstance", params)
resp, err := self.ecsRequest("RunInstances", params)
if err != nil {
log.Errorf("CreateInstance fail %s", err)
return "", err
return "", errors.Wrapf(err, "RunInstances")
}
instanceId, _ := body.GetString("InstanceId")
return instanceId, nil
ids := []string{}
err = resp.Unmarshal(&ids, "InstanceIdSets", "InstanceIdSet")
if err != nil {
return "", errors.Wrapf(err, "Unmarshal")
}
for _, id := range ids {
err = cloudprovider.Wait(time.Second*3, time.Minute, func() (bool, error) {
_, err := self.GetInstance(id)
if err != nil {
if errors.Cause(err) == cloudprovider.ErrNotFound {
return false, nil
}
return false, err
}
return true, nil
})
if err != nil {
return "", errors.Wrapf(cloudprovider.ErrNotFound, "after vm %s created", id)
}
return id, nil
}
return "", errors.Wrapf(cloudprovider.ErrNotFound, "after created")
}
func (self *SRegion) AllocatePublicIpAddress(instanceId string) (string, error) {