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
  • Loading branch information
tg123 committed Jul 13, 2015
1 parent 42c7b6a commit 2a2fda2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/aliyunecs/ecs.go
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 2a2fda2

Please sign in to comment.