Skip to content

Commit

Permalink
fix using private ip address in digitalocean builder
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Tolstov <[email protected]>
  • Loading branch information
vtolstov committed Nov 12, 2014
1 parent 80eb4c2 commit 1e87e79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions builder/digitalocean/api_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ func (d DigitalOceanClientV2) DropletStatus(id uint) (string, string, error) {
}
var ip string

if len(res.Droplet.Networks.V4) > 0 {
ip = res.Droplet.Networks.V4[0].IPAddr
for _, n := range res.Droplet.Networks.V4 {
if n.Type == "public" {
ip = n.IPAddr
}
}

return ip, res.Droplet.Status, err
Expand Down

0 comments on commit 1e87e79

Please sign in to comment.