mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): vendor update (#23654)
This commit is contained in:
@@ -88,7 +88,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.20251029114425-e74e51b2ee51
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251031063547-6f3e6df68ca4
|
||||
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
|
||||
|
||||
@@ -1279,8 +1279,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.20251029114425-e74e51b2ee51 h1:gbA7+xd3rsHgj8W2XCNBRet5hSdbiBoME3082fs/p4U=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251029114425-e74e51b2ee51/go.mod h1:S9o/TRZsnYWGaGe7o3PpeOv6CgMY8ZJwITYsEnGfOgQ=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251031063547-6f3e6df68ca4 h1:qdL3zFEFQyvXGYOv7uQjoD03pi6QRQsT4hatx7jQ2eM=
|
||||
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251031063547-6f3e6df68ca4/go.mod h1:S9o/TRZsnYWGaGe7o3PpeOv6CgMY8ZJwITYsEnGfOgQ=
|
||||
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=
|
||||
|
||||
Vendored
+1
-1
@@ -1605,7 +1605,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.20251029114425-e74e51b2ee51
|
||||
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20251031063547-6f3e6df68ca4
|
||||
## explicit; go 1.21
|
||||
yunion.io/x/cloudmux/pkg/apis
|
||||
yunion.io/x/cloudmux/pkg/apis/billing
|
||||
|
||||
+7
-6
@@ -111,13 +111,14 @@ func (cli *SGoogleClient) GetGlobalNetworks(maxResults int, pageToken string) ([
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "ecsList")
|
||||
}
|
||||
if resp.Contains("items") {
|
||||
err = resp.Unmarshal(&networks, "items")
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "resp.Unmarshal")
|
||||
}
|
||||
ret := struct {
|
||||
Items []SGlobalNetwork
|
||||
}{}
|
||||
err = resp.Unmarshal(&ret)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "resp.Unmarshal")
|
||||
}
|
||||
return networks, nil
|
||||
return ret.Items, nil
|
||||
}
|
||||
|
||||
func (self *SGoogleClient) CreateGlobalNetwork(name string, desc string) (*SGlobalNetwork, error) {
|
||||
|
||||
+5
-3
@@ -76,12 +76,14 @@ func (self *SGoogleClient) TestIam(permissions []string) ([]string, error) {
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "testIamPermissions")
|
||||
}
|
||||
ret := []string{}
|
||||
err = resp.Unmarshal(&ret, "permissions")
|
||||
ret := struct {
|
||||
Permissions []string
|
||||
}{}
|
||||
err = resp.Unmarshal(&ret)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "resp.Unmarshal")
|
||||
}
|
||||
return ret, nil
|
||||
return ret.Permissions, nil
|
||||
}
|
||||
|
||||
func (self *SGoogleClient) IsSupportCloudId() bool {
|
||||
|
||||
+8
-8
@@ -58,16 +58,16 @@ func (cli *SGoogleClient) GetProjects() ([]SProject, error) {
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "managerList")
|
||||
}
|
||||
_result := []SProject{}
|
||||
if resp.Contains("projects") {
|
||||
err = resp.Unmarshal(&_result, "projects")
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "data.Unmarshal")
|
||||
}
|
||||
part := struct {
|
||||
Projects []SProject
|
||||
}{}
|
||||
err = resp.Unmarshal(&part)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "resp.Unmarshal")
|
||||
}
|
||||
result = append(result, _result...)
|
||||
result = append(result, part.Projects...)
|
||||
nextPageToken, _ = resp.GetString("nextPageToken")
|
||||
if len(nextPageToken) == 0 || len(_result) == 0 {
|
||||
if len(nextPageToken) == 0 || len(part.Projects) == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
+6
-4
@@ -46,10 +46,12 @@ func (self *SGoogleClient) ListOrganizations() ([]SOrganization, error) {
|
||||
return nil, errors.Wrap(err, "ListOrganizations")
|
||||
}
|
||||
log.Debugf("ListOrganization: %s", resp)
|
||||
ret := make([]SOrganization, 0)
|
||||
err = resp.Unmarshal(&ret, "organizations")
|
||||
ret := struct {
|
||||
Organizations []SOrganization
|
||||
}{}
|
||||
err = resp.Unmarshal(&ret)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "resp.Unmarshal")
|
||||
return nil, errors.Wrapf(err, "resp.Unmarshal")
|
||||
}
|
||||
return ret, nil
|
||||
return ret.Organizations, nil
|
||||
}
|
||||
|
||||
+4
-3
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
api "yunion.io/x/cloudmux/pkg/apis/compute"
|
||||
"yunion.io/x/cloudmux/pkg/cloudprovider"
|
||||
"yunion.io/x/pkg/errors"
|
||||
)
|
||||
|
||||
type SSharedGlobalNetwork struct {
|
||||
@@ -72,20 +73,20 @@ func (client *SGoogleClient) GetSharedGlobalNetworks() ([]SSharedGlobalNetwork,
|
||||
if e, ok := err.(*gError); ok && e.ErrorInfo.Code == 400 {
|
||||
return []SSharedGlobalNetwork{}, nil
|
||||
}
|
||||
return nil, err
|
||||
return nil, errors.Wrapf(err, "GetXpnHosts")
|
||||
}
|
||||
ret := []SSharedGlobalNetwork{}
|
||||
networkMap := map[string][]SXpnNetwork{}
|
||||
for _, xhost := range xhosts {
|
||||
resources, err := client.GetXpnResources(xhost.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrapf(err, "GetXpnResources(%s)", xhost.Name)
|
||||
}
|
||||
for _, resource := range resources {
|
||||
if strings.EqualFold(resource.Type, "project") && resource.Id == client.projectId {
|
||||
networks, err := client.GetXpnNetworks(xhost.Name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrapf(err, "GetXpnNetworks(%s)", xhost.Name)
|
||||
}
|
||||
for i := range networks {
|
||||
_, ok := networkMap[networks[i].Network]
|
||||
|
||||
+10
-6
@@ -13,12 +13,14 @@ func (cli *SGoogleClient) GetXpnHosts() ([]SXpnHost, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := []SXpnHost{}
|
||||
err = resp.Unmarshal(&ret, "items")
|
||||
ret := struct {
|
||||
Items []SXpnHost
|
||||
}{}
|
||||
err = resp.Unmarshal(&ret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
return ret.Items, nil
|
||||
}
|
||||
|
||||
type SXpnResource struct {
|
||||
@@ -32,10 +34,12 @@ func (cli *SGoogleClient) GetXpnResources(projectId string) ([]SXpnResource, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := []SXpnResource{}
|
||||
err = resp.Unmarshal(&ret, "resources")
|
||||
ret := struct {
|
||||
Resources []SXpnResource
|
||||
}{}
|
||||
err = resp.Unmarshal(&ret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
return ret.Resources, nil
|
||||
}
|
||||
|
||||
+5
-3
@@ -108,10 +108,12 @@ func (client *SGoogleClient) GetXpnNetworks(projectId string) ([]SXpnNetwork, er
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ret := []SXpnNetwork{}
|
||||
err = resp.Unmarshal(&ret, "items")
|
||||
ret := struct {
|
||||
Items []SXpnNetwork
|
||||
}{}
|
||||
err = resp.Unmarshal(&ret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ret, nil
|
||||
return ret.Items, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user