Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error when updating IPv6 Primary IP #215

Merged
merged 1 commit into from Nov 10, 2022

Commits on Nov 10, 2022

  1. fix: error when updating IPv6 Primary IP

    The API returns a CIDR range in the `ip` field for ipv6 primary IPs. This
    caused the `PrimaryIPClient.Update` call to fail, because the response
    was parsed as a `net.IP`, but should have been parsed using `net.ParseNetwork`.
    
    The required logic was already implemented in the `PrimaryIPFromSchema`
    function, but not used for the update call.
    
    With this commit, the struct `hcloud.PrimaryIPUpdateResult` is removed,
    because using it to parse the response causes the error and it was never
    returned from any of our methods, so consumers should not be using it.
    
    This error was originally found in hcloud-cli, and caused following error
    message:
    
        ➜  ~ hcloud primary-ip update --auto-delete=false test-ip
        hcloud: updating Primary IP test-ip failed: invalid IP address: 2001:db8::/64
    apricote committed Nov 10, 2022
    Copy the full SHA
    532d840 View commit details
    Browse the repository at this point in the history