Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: error when updating IPv6 Primary IP (#215)
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
- Loading branch information
Showing
3 changed files
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters