fix(deps): update module github.com/hetznercloud/hcloud-go/v2 to v2.25.0
This MR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| github.com/hetznercloud/hcloud-go/v2 |
v2.24.0 -> v2.25.0
|
Release Notes
hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)
v2.25.0
Server Types now depend on Locations.
-
We added a new
locationsproperty to the Server Types resource. The new property defines a list of supported Locations and additional per Locations details such as deprecations information. -
We deprecated the
deprecationproperty from the Server Types resource. The property will gradually be phased out as per Locations deprecations are being announced. Please use the new per Locations deprecation information instead.
See our changelog for more details.
Upgrading
// Before
func ValidateServerType(serverType *hcloud.ServerType) error {
if serverType.IsDeprecated() {
return fmt.Errorf("server type %s is deprecated", serverType.Name)
}
return nil
}
// After
func ValidateServerType(serverType *hcloud.ServerType, location *hcloud.Location) error {
serverTypeLocationIndex := slices.IndexFunc(serverType.Locations, func(e hcloud.ServerTypeLocation) bool {
return e.Location.Name == location.Name
})
if serverTypeLocationIndex < 0 {
return fmt.Errorf("server type %s is not supported in location %q", serverType.Name, location.Name)
}
if serverType.Locations[serverTypeLocationIndex].IsDeprecated() {
return fmt.Errorf("server type %q is deprecated in location %q", serverType.Name, location.Name)
}
return nil
}
Features
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.