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
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 marked as deprecated, because using it to parse the response causes the error. 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
18 additions
and
6 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