From 3d479e776fd4cedb56e63cd49354d4372e1d8fdf Mon Sep 17 00:00:00 2001 From: TangBin Date: Wed, 24 Oct 2018 18:11:44 +0800 Subject: [PATCH] add eip --- pkg/util/aws/eip.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pkg/util/aws/eip.go b/pkg/util/aws/eip.go index 0c5ead1720..bdf5d2f691 100644 --- a/pkg/util/aws/eip.go +++ b/pkg/util/aws/eip.go @@ -14,7 +14,7 @@ type SEipAddress struct { AllocationId string Bandwidth int - Tags STags + Tags TagSpec Status string InstanceId string AssociationId string @@ -141,14 +141,17 @@ func (self *SRegion) GetEips(eipId string, offset int, limit int) ([]SEipAddress eips := make([]SEipAddress, 0) for _, ip := range res.Addresses { + tagspec := TagSpec{ResourceType: "eip"} + tagspec.LoadingEc2Tags(ip.Tags) + eips = append(eips, SEipAddress{region: self, AllocationId: *ip.AllocationId, - Tags: STags{}, - InstanceId: *ip.InstanceId, + Tags: tagspec, + InstanceId: StrVal(ip.InstanceId), AssociationId: *ip.AssociationId, Domain: *ip.Domain, - NetworkInterfaceId: *ip.NetworkInterfaceId, - NetworkInterfaceOwnerId: *ip.NetworkInterfaceOwnerId, - PrivateIpAddress: *ip.PrivateIpAddress, + NetworkInterfaceId: StrVal(ip.NetworkInterfaceId), + NetworkInterfaceOwnerId: StrVal(ip.NetworkInterfaceOwnerId), + PrivateIpAddress: StrVal(ip.PrivateIpAddress), IpAddress: *ip.PublicIp, }) }