equinix / terraform-provider-equinix

Terraform Equinix provider
https://deploy.equinix.com/labs/terraform-provider-equinix/
MIT License
47 stars 45 forks source link

fix: Fix provider crash when creating a metal gateway tied to an ipv6 reservation #713

Closed RaptorGandalf closed 1 week ago

RaptorGandalf commented 1 week ago

This PR fixes a bug when creating metal gateways associated with IPv6 reservations. Previously the provider would assume the gateway was tied to an IPv4 reservation, which would result in an error when the calculateSubnetSize function was called.

To fix this, an additional check was added to the calculateSubnetSize function which ensures the address is actually IPv4 before executing the private ipv4 subnet logic.

Additionally an acceptance test was added which creates a metal gateway associated with an IPv6 reservation and VRF.