Skip to content

Commit 50897df

Browse files
deps: update module github.com/hetznercloud/hcloud-go/v2 to v2.25.0 (#1168)
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more [here](https://redirect.github.com/renovatebot/renovate/discussions/37842). This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/hetznercloud/hcloud-go/v2](https://redirect.github.com/hetznercloud/hcloud-go) | `v2.24.0` -> `v2.25.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.24.0/v2.25.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)</summary> ### [`v2.25.0`](https://redirect.github.com/hetznercloud/hcloud-go/blob/HEAD/CHANGELOG.md#v2250) [Compare Source](https://redirect.github.com/hetznercloud/hcloud-go/compare/v2.24.0...v2.25.0) [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) now depend on [Locations](https://docs.hetzner.cloud/reference/cloud#locations). - We added a new `locations` property to the [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) resource. The new property defines a list of supported [Locations](https://docs.hetzner.cloud/reference/cloud#locations) and additional per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) details such as deprecations information. - We deprecated the `deprecation` property from the [Server Types](https://docs.hetzner.cloud/reference/cloud#server-types) resource. The property will gradually be phased out as per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) deprecations are being announced. Please use the new per [Locations](https://docs.hetzner.cloud/reference/cloud#locations) deprecation information instead. See our [changelog](https://docs.hetzner.cloud/changelog#2025-09-24-per-location-server-types) for more details. ##### Upgrading ```go // Before func ValidateServerType(serverType *hcloud.ServerType) error { if serverType.IsDeprecated() { return fmt.Errorf("server type %s is deprecated", serverType.Name) } return nil } ``` ```go // 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 - **exp**: add `sliceutil.Transform` function ([#&#8203;731](https://redirect.github.com/hetznercloud/hcloud-go/issues/731)) - per locations server types ([#&#8203;730](https://redirect.github.com/hetznercloud/hcloud-go/issues/730)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/hetznercloud/cli). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45Ny4xMCIsInVwZGF0ZWRJblZlciI6IjQxLjk3LjEwIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo <ljonas@riseup.net>
1 parent 73b208f commit 50897df

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/fatih/structs v1.1.0
1313
github.com/goccy/go-yaml v1.18.0
1414
github.com/guptarohit/asciigraph v0.7.3
15-
github.com/hetznercloud/hcloud-go/v2 v2.24.0
15+
github.com/hetznercloud/hcloud-go/v2 v2.25.0
1616
github.com/jedib0t/go-pretty/v6 v6.6.8
1717
github.com/spf13/cast v1.10.0
1818
github.com/spf13/cobra v1.10.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
3737
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
3838
github.com/guptarohit/asciigraph v0.7.3 h1:p05XDDn7cBTWiBqWb30mrwxd6oU0claAjqeytllnsPY=
3939
github.com/guptarohit/asciigraph v0.7.3/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag=
40-
github.com/hetznercloud/hcloud-go/v2 v2.24.0 h1:57YlEQOc9QperCGck+iX4MqCrwEsznEdK7bPrsdAgOQ=
41-
github.com/hetznercloud/hcloud-go/v2 v2.24.0/go.mod h1:uQdAWaW3d9TimiyOjQWY8HKShs0Nd6S4wNYqo0HjvIY=
40+
github.com/hetznercloud/hcloud-go/v2 v2.25.0 h1:vW8rC+ArxSAI7YYkRWQf+7CKnYE+Z++MabzZADaPvi4=
41+
github.com/hetznercloud/hcloud-go/v2 v2.25.0/go.mod h1:uQdAWaW3d9TimiyOjQWY8HKShs0Nd6S4wNYqo0HjvIY=
4242
github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
4343
github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE=
4444
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=

internal/cmd/server/create_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,20 @@ func TestCreateJSON(t *testing.T) {
151151
Disk: 20,
152152
StorageType: "local",
153153
Architecture: hcloud.ArchitectureX86,
154+
Locations: []hcloud.ServerTypeLocation{
155+
{
156+
Location: &hcloud.Location{
157+
ID: 1,
158+
Name: "fsn1",
159+
},
160+
},
161+
{
162+
Location: &hcloud.Location{
163+
ID: 2,
164+
Name: "nbg1",
165+
},
166+
},
167+
},
154168
},
155169
Image: &hcloud.Image{
156170
ID: 1,

internal/cmd/server/testdata/create_response.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@
9999
"memory": 2,
100100
"name": "cx22",
101101
"prices": null,
102-
"storage_type": "local"
102+
"storage_type": "local",
103+
"locations": [
104+
{ "id": 1, "name": "fsn1", "deprecation": null },
105+
{ "id": 2, "name": "nbg1", "deprecation": null }
106+
]
103107
},
104108
"status": "running",
105109
"volumes": null

0 commit comments

Comments
 (0)