fix(region): vendor update (#17871)

This commit is contained in:
屈轩
2023-08-29 16:17:32 +08:00
committed by GitHub
parent b462ef3abe
commit fb63245840
6 changed files with 56 additions and 15 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.20230829065343-09bd470458fa
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230829080506-5b975c64c67c
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
@@ -1174,8 +1174,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.20230829065343-09bd470458fa h1:eRVm5vrxMrrrwokjX7/QgN9o41W1l/VrD+y5VTEcqqs=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230829065343-09bd470458fa/go.mod h1:2sgCN7nRPQL3woLfdgqLDd92vwAHqtlz3KKiHxC5BAw=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230829080506-5b975c64c67c h1:QVorptnv2PtZPQEEbFl4kugZrC/g9HsBOwTr2ufwQ/0=
yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230829080506-5b975c64c67c/go.mod h1:2sgCN7nRPQL3woLfdgqLDd92vwAHqtlz3KKiHxC5BAw=
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
@@ -1437,7 +1437,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.20230829065343-09bd470458fa
# yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20230829080506-5b975c64c67c
## explicit; go 1.18
yunion.io/x/cloudmux/pkg/apis
yunion.io/x/cloudmux/pkg/apis/billing
+1 -1
View File
@@ -93,7 +93,7 @@ func Unmarshal(r *request.Request) {
case xml.CharData:
continue
case xml.StartElement:
if typed.Name.Local == r.Operation.Name+"Result" || typed.Name.Local == r.Operation.Name+"Response" {
if typed.Name.Local == r.Operation.Name+"Result" || (typed.Name.Local == r.Operation.Name+"Response" && r.ClientInfo.ServiceID == ROUTE53_SERVICE_ID) {
err = decoder.DecodeElement(r.Data, &typed)
if err != nil {
r.Error = awserr.NewRequestFailure(
+2 -9
View File
@@ -465,23 +465,16 @@ func (self *SRegion) DescribeElbTags(arn string) (map[string]string, error) {
ret := struct {
TagDescriptions []struct {
ResourceArn string `xml:"ResourceArn"`
Tags []struct {
Key string
Value string
} `xml:"Tags>member"`
AwsTags
} `xml:"TagDescriptions>member"`
}{}
err := self.elbRequest("DescribeTags", map[string]string{"ResourceArns.member.1": arn}, &ret)
if err != nil {
return nil, errors.Wrapf(err, "DescribeTags")
}
result := map[string]string{}
for _, res := range ret.TagDescriptions {
if res.ResourceArn == arn {
for _, tag := range res.Tags {
result[tag.Key] = tag.Value
}
return result, nil
return res.AwsTags.GetTags()
}
}
return nil, cloudprovider.ErrNotFound
+49 -1
View File
@@ -32,10 +32,17 @@ type SAwsRdsTag struct {
Value string `xml:"Value"`
}
type SAwsLbTag struct {
Key string `xml:"Key"`
Value string `xml:"Value"`
}
type AwsTags struct {
TagSet []SAwsTag `xml:"tagSet>item"`
// rds
TagList []SAwsRdsTag `xml:"TagList>Tag"`
// elb
Tags []SAwsLbTag `xml:"Tags>member"`
}
func (self AwsTags) GetName() string {
@@ -44,6 +51,16 @@ func (self AwsTags) GetName() string {
return tag.Value
}
}
for _, tag := range self.TagList {
if strings.ToLower(tag.Key) == "name" {
return tag.Value
}
}
for _, tag := range self.Tags {
if strings.ToLower(tag.Key) == "name" {
return tag.Value
}
}
return ""
}
@@ -53,19 +70,50 @@ func (self *AwsTags) GetTags() (map[string]string, error) {
if tag.Key == "Name" || tag.Key == "Description" {
continue
}
if strings.HasPrefix(tag.Key, "aws:") {
continue
}
ret[tag.Key] = tag.Value
}
for _, tag := range self.TagList {
if strings.ToLower(tag.Key) == "name" || strings.ToLower(tag.Key) == "description" {
continue
}
if strings.HasPrefix(tag.Key, "aws:") {
continue
}
ret[tag.Key] = tag.Value
}
for _, tag := range self.Tags {
if strings.ToLower(tag.Key) == "name" || strings.ToLower(tag.Key) == "description" {
continue
}
if strings.HasPrefix(tag.Key, "aws:") {
continue
}
ret[tag.Key] = tag.Value
}
return ret, nil
}
func (self *AwsTags) GetSysTags() map[string]string {
return nil
ret := map[string]string{}
for _, tag := range self.TagSet {
if strings.HasPrefix(tag.Key, "aws:") {
ret[tag.Key] = tag.Value
}
}
for _, tag := range self.TagList {
if strings.HasPrefix(tag.Key, "aws:") {
ret[tag.Key] = tag.Value
}
}
for _, tag := range self.Tags {
if strings.HasPrefix(tag.Key, "aws:") {
ret[tag.Key] = tag.Value
}
}
return ret
}
func (self *AwsTags) SetTags(tags map[string]string, replace bool) error {