Skip to content

Primary IPs are missing the IPv6 subnet #891

Description

@apricote

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions