TL;DR
The hcloud.PrimaryIP resource is dropping the IPv6 subnet information. The API sends us a foo::/64 subnet, but the IP field in the returned struct only has foo::.
Expected behavior
The hcloud.PrimaryIP struct should represent the full information as returned by the API.
Observed behavior
For IPv6 addresses the subnet size is dropped/hidden. This may confuse users because the only see the single address, which is not even the one our default configuration listens on.
Minimal working example
No response
Log output
Additional information
API Docs: https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/get_primary_ip
The net is dropped here (second return value from net.ParseCIDR):
|
func ipFromPrimaryIPSchema(s schema.PrimaryIP) net.IP { |
|
if s.Type == string(FloatingIPTypeIPv4) { |
|
return net.ParseIP(s.IP) |
|
} |
|
ip, _, _ := net.ParseCIDR(s.IP) |
|
return ip |
|
} |
TL;DR
The
hcloud.PrimaryIPresource is dropping the IPv6 subnet information. The API sends us afoo::/64subnet, but theIPfield in the returned struct only hasfoo::.Expected behavior
The
hcloud.PrimaryIPstruct should represent the full information as returned by the API.Observed behavior
For IPv6 addresses the subnet size is dropped/hidden. This may confuse users because the only see the single address, which is not even the one our default configuration listens on.
Minimal working example
No response
Log output
Additional information
API Docs: https://docs.hetzner.cloud/reference/cloud#tag/primary-ips/get_primary_ip
The net is dropped here (second return value from
net.ParseCIDR):hcloud-go/hcloud/schema_gen.go
Lines 461 to 467 in 41b4e80