mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-29 03:51:54 +08:00
fix(region): vendor update (#23994)
This commit is contained in:
@@ -98,7 +98,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.20251205085801-178d14a173e0
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251224112641-a56dd685232b
|
||||
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
|
||||
|
||||
@@ -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.20251205085801-178d14a173e0 h1:qCGkj0FDYNdWVUlD2RXsp5FMPCfJjri6E6djUDItWz8=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251205085801-178d14a173e0/go.mod h1:aWRX5Phwz3nbHUNnIAm1oVogjguXPYDDgCOy/9Hnnvk=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251224112641-a56dd685232b h1:LjRozyb00R7cbBFQFr0zrB9iN4IbJNXXepXfM1M0YcE=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251224112641-a56dd685232b/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=
|
||||
|
||||
@@ -240,6 +240,8 @@ type ComputeOptions struct {
|
||||
SkipSyncHostConfigInfoProviders string `help:"Skip sync host cpu and mem config by provider"`
|
||||
SkipSyncStorageConfigInfoProviders string `help:"Skip sync storage capacity and media type config by provider"`
|
||||
|
||||
KsyunPostpaidChargeType string `help:"Ksyun server postpaid charge type" choices:"Daily|HourlyInstantSettlement"`
|
||||
|
||||
esxi.EsxiOptions
|
||||
|
||||
NetworkAlwaysManualConfig bool `help:"always manually configure network settings" default:"false"`
|
||||
|
||||
Vendored
+1
-1
@@ -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.20251205085801-178d14a173e0
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251224112641-a56dd685232b
|
||||
## explicit; go 1.24
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
|
||||
+4
@@ -161,6 +161,10 @@ type SManagedVMCreateConfig struct {
|
||||
ProjectId string
|
||||
EnableMonitorAgent bool
|
||||
|
||||
// 金山云按量付费类型
|
||||
// Daily(按量付费(按日月结))、 HourlyInstantSettlement(按量付费(按小时月结))
|
||||
KsyunPostpaidChargeType string
|
||||
|
||||
SPublicIpInfo
|
||||
|
||||
Tags map[string]string
|
||||
|
||||
+24
-3
@@ -17,6 +17,7 @@ package aws
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
@@ -122,15 +123,35 @@ func jsonInvoke(cli *client.Client, apiName, path string, params map[string]inte
|
||||
},
|
||||
}
|
||||
|
||||
isQuery := false
|
||||
for _, prefix := range []string{"List", "Describe", "Get"} {
|
||||
if strings.HasPrefix(apiName, prefix) {
|
||||
isQuery = true
|
||||
break
|
||||
}
|
||||
}
|
||||
var err error
|
||||
|
||||
retry := 1
|
||||
if isQuery {
|
||||
retry = 3
|
||||
}
|
||||
req := cli.NewRequest(op, params, retval)
|
||||
err := req.Send()
|
||||
if err != nil {
|
||||
for i := 0; i < retry; i++ {
|
||||
err = req.Send()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if e, ok := err.(awserr.RequestFailure); ok && e.StatusCode() == 404 {
|
||||
return cloudprovider.ErrNotFound
|
||||
}
|
||||
if isHTTPReqErrorRetryable(err) {
|
||||
time.Sleep(time.Second * 10)
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
var JsonBuildHandler = request.NamedHandler{
|
||||
|
||||
+40
-4
@@ -21,6 +21,7 @@ import (
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
@@ -268,7 +269,13 @@ func (self *SAwsClient) request(regionId, serviceName, serviceId, apiVersion str
|
||||
}
|
||||
|
||||
func jsonRequest(cli *client.Client, apiName string, params map[string]string, retval interface{}) error {
|
||||
method, path := "POST", "/"
|
||||
method, path, isQuery := "POST", "/", false
|
||||
for _, prefix := range []string{"List", "Get", "Describe"} {
|
||||
if strings.HasPrefix(apiName, prefix) {
|
||||
isQuery = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if cli.ServiceID == CDN_SERVICE_ID {
|
||||
for _, prefix := range []string{"List", "Get"} {
|
||||
if strings.HasPrefix(apiName, prefix) {
|
||||
@@ -343,12 +350,41 @@ func jsonRequest(cli *client.Client, apiName string, params map[string]string, r
|
||||
}
|
||||
|
||||
req := cli.NewRequest(op, params, retval)
|
||||
err := req.Send()
|
||||
if err != nil {
|
||||
retry := 1
|
||||
if isQuery {
|
||||
retry = 3
|
||||
}
|
||||
var err error
|
||||
for i := 0; i < retry; i++ {
|
||||
err = req.Send()
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if e, ok := err.(awserr.RequestFailure); ok && e.StatusCode() == 404 {
|
||||
return cloudprovider.ErrNotFound
|
||||
}
|
||||
if isHTTPReqErrorRetryable(err) {
|
||||
time.Sleep(time.Second * 10)
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func isHTTPReqErrorRetryable(err error) bool {
|
||||
for _, code := range []string{
|
||||
"EOF",
|
||||
"i/o timeout",
|
||||
"TLS handshake timeout",
|
||||
"Client.Timeout exceeded while awaiting headers",
|
||||
"connection reset by peer",
|
||||
"context deadline exceeded",
|
||||
"server misbehaving",
|
||||
} {
|
||||
if strings.Contains(err.Error(), code) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
+4
@@ -22,6 +22,7 @@ import (
|
||||
"yunion.io/x/cloudmux/pkg/cloudprovider"
|
||||
"yunion.io/x/cloudmux/pkg/multicloud"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
)
|
||||
@@ -92,6 +93,9 @@ func (region *SRegion) CreateVM(opts *cloudprovider.SManagedVMCreateConfig) (*SI
|
||||
"SystemDisk.DiskSize": fmt.Sprintf("%d", opts.SysDisk.SizeGB),
|
||||
"SyncTag": "true",
|
||||
}
|
||||
if utils.IsInStringArray(opts.KsyunPostpaidChargeType, []string{"HourlyInstantSettlement", "Daily"}) {
|
||||
params["ChargeType"] = opts.KsyunPostpaidChargeType
|
||||
}
|
||||
if len(opts.Hostname) > 0 {
|
||||
params["HostName"] = opts.Hostname
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user