Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
add vpc private ip support
Browse files Browse the repository at this point in the history
Signed-off-by: tgic <farmer1992@gmail.com>
  • Loading branch information
tg123 committed Jul 13, 2015
1 parent 61f7a7b commit e82b172
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/aliyunecs/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ func (d *Driver) getIP(inst *ecs.InstanceAttributesType) string {
if inst.InnerIpAddress.IpAddress != nil && len(inst.InnerIpAddress.IpAddress) > 0 {
return inst.InnerIpAddress.IpAddress[0]
}

if inst.VpcAttributes.PrivateIpAddress.IpAddress != nil && len(inst.VpcAttributes.PrivateIpAddress.IpAddress) > 0 {
return inst.VpcAttributes.PrivateIpAddress.IpAddress[0]
}
}
if inst.PublicIpAddress.IpAddress != nil && len(inst.PublicIpAddress.IpAddress) > 0 {
return inst.PublicIpAddress.IpAddress[0]
Expand Down

0 comments on commit e82b172

Please sign in to comment.