Skip to content

Commit

Permalink
Merge pull request #1301 from MZC-CSC/master
Browse files Browse the repository at this point in the history
[Tencent] Include tag information when get VPC
  • Loading branch information
powerkimhub authored Aug 26, 2024
2 parents dab8b06 + d270603 commit b864bc3
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ func ExtractVpcDescribeInfo(vpcInfo *vpc.Vpc) irs.VPCInfo {
IPv4_CIDR: *vpcInfo.CidrBlock,
}

if vpcInfo.TagSet != nil {
var tagList []irs.KeyValue
for _, tag := range vpcInfo.TagSet {
tagList = append(tagList, irs.KeyValue{
Key: *tag.Key,
Value: *tag.Value,
})
}
resVpcInfo.TagList = tagList
}

return resVpcInfo
}

Expand Down Expand Up @@ -362,6 +373,17 @@ func (VPCHandler *TencentVPCHandler) ListSubnet(reqVpcId string) ([]irs.SubnetIn
//Status: *subnetInfo.State,
}

if curSubnet.TagSet != nil {
var tagList []irs.KeyValue
for _, tag := range curSubnet.TagSet {
tagList = append(tagList, irs.KeyValue{
Key: *tag.Key,
Value: *tag.Value,
})
}
resSubnetInfo.TagList = tagList
}

keyValueList := []irs.KeyValue{
{Key: "VpcId", Value: *curSubnet.VpcId},
{Key: "IsDefault", Value: strconv.FormatBool(*curSubnet.IsDefault)},
Expand Down

0 comments on commit b864bc3

Please sign in to comment.