Skip to content

Commit

Permalink
Fixed plurality in ipv6_addresses of VPS data source and IPv4 and IPv…
Browse files Browse the repository at this point in the history
…6 split
  • Loading branch information
kevinvalk committed Jun 14, 2020
1 parent 727e620 commit 5aa50e7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions transip/data_source_transip_vps.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func dataSourceVps() *schema.Resource {
Type: schema.TypeString,
},
},
"ipv6_address": {
"ipv6_addresses": {
Computed: true,
Type: schema.TypeList,
Elem: &schema.Schema{
Expand Down Expand Up @@ -110,10 +110,9 @@ func dataSourceVpsRead(d *schema.ResourceData, m interface{}) error {
var ipv4Addresses []string
var ipv6Addresses []string
for _, address := range ipAddresses {
if len(address.Address) == 4 {
if address.Address.To4() != nil {
ipv4Addresses = append(ipv4Addresses, address.Address.String())
}
if len(address.Address) == 16 {
} else {
ipv6Addresses = append(ipv6Addresses, address.Address.String())
}
}
Expand Down

0 comments on commit 5aa50e7

Please sign in to comment.