From b68acbb2620e90e5a3608636960aad7afa12d697 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 25 Jul 2024 17:31:22 +0200
Subject: [PATCH] deps: update module github.com/hetznercloud/hcloud-go/v2 to
v2.12.0 (#672)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/hetznercloud/hcloud-go/v2](https://togithub.com/hetznercloud/hcloud-go)
| `v2.11.0` -> `v2.12.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.11.0/v2.12.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.11.0/v2.12.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
hetznercloud/hcloud-go
(github.com/hetznercloud/hcloud-go/v2)
###
[`v2.12.0`](https://togithub.com/hetznercloud/hcloud-go/releases/tag/v2.12.0)
[Compare
Source](https://togithub.com/hetznercloud/hcloud-go/compare/v2.11.0...v2.12.0)
##### API Changes for Traffic Prices and Server Type Included Traffic
There will be a breaking change in the API regarding Traffic Prices and
Server Type Included Traffic on 2024-08-05. This release marks the
affected fields as `Deprecated`. Please check if this affects any of
your code and switch to the replacement fields where necessary.
You can learn more about this change in [our
changelog](https://docs.hetzner.cloud/changelog#2024-07-25-cloud-api-returns-traffic-information-in-different-format).
##### Upgrading
##### Server Type Included Traffic
If you were using the field `hcloud.ServerType.IncludedTraffic`, you can
now get the information through `hcloud.ServerType.Pricings`:
```go
func main() {
// previous
includedTraffic := serverType.IncludedTraffic
// now
locationOfInterest := "fsn1"
var includedTraffic uint64
for _, price := range serverType.Pricings {
if price.Location.Name == locationOfInterest {
includedTraffic = price.IncludedTraffic
break
}
}
}
```
##### Traffic Prices
If you were using the field `hcloud.Pricing.Traffic`, you can now get
the information through `hcloud.Pricing.ServerTypes` or
`hcloud.Pricing.LoadBalancerTypes`:
```go
func main() {
// previous
trafficPrice := pricing.Traffic
// now
serverTypeOfInterest := "cx22"
locationOfInterest := "fsn1"
var trafficPrice hcloud.Price
for _, serverTypePricings := range pricing.ServerTypes {
if serverTypePricings.ServerType.Name == serverTypeOfInterest {
for _, price := range serverTypePricings {
if price.Location.Name == locationOfInterest {
trafficPrice = price.PerTBTraffic
break
}
}
}
}
}
```
##### Features
- add jitter in the client default retry exponential backoff
([#492](https://togithub.com/hetznercloud/hcloud-go/issues/492))
([6205076](https://togithub.com/hetznercloud/hcloud-go/commit/6205076b89350bdbf08bc6b771a1d1267a3ac422))
- add new `WithPollOpts` client option
([#493](https://togithub.com/hetznercloud/hcloud-go/issues/493))
([2c1a2d6](https://togithub.com/hetznercloud/hcloud-go/commit/2c1a2d65596bcbe282ff004c1a9da89950e754df))
- allow checking multiple errors codes in `IsError`
([#491](https://togithub.com/hetznercloud/hcloud-go/issues/491))
([af59ab8](https://togithub.com/hetznercloud/hcloud-go/commit/af59ab846665abd735c9717eb2a47c0a8c79776d))
- **load-balancer-type:** new traffic price fields
([94e0f44](https://togithub.com/hetznercloud/hcloud-go/commit/94e0f44d269fdb5138485a6e69dae9105690e4b0))
- **pricing:** mark traffic field as deprecated
([94e0f44](https://togithub.com/hetznercloud/hcloud-go/commit/94e0f44d269fdb5138485a6e69dae9105690e4b0))
- **server-type:** mark included traffic field as deprecated
([94e0f44](https://togithub.com/hetznercloud/hcloud-go/commit/94e0f44d269fdb5138485a6e69dae9105690e4b0))
- **server-type:** new traffic price fields
([94e0f44](https://togithub.com/hetznercloud/hcloud-go/commit/94e0f44d269fdb5138485a6e69dae9105690e4b0))
---
### 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.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/hetznercloud/csi-driver).
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo
---
go.mod | 2 +-
go.sum | 2 ++
internal/api/volume_test.go | 2 +-
internal/app/app.go | 4 +++-
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/go.mod b/go.mod
index 4d238a6d..62b4e691 100644
--- a/go.mod
+++ b/go.mod
@@ -10,7 +10,7 @@ require (
github.com/golang/protobuf v1.5.4
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
- github.com/hetznercloud/hcloud-go/v2 v2.11.0
+ github.com/hetznercloud/hcloud-go/v2 v2.12.0
github.com/kubernetes-csi/csi-test/v5 v5.2.0
github.com/prometheus/client_golang v1.19.1
github.com/stretchr/testify v1.9.0
diff --git a/go.sum b/go.sum
index c3615b50..5f9637b8 100644
--- a/go.sum
+++ b/go.sum
@@ -62,6 +62,8 @@ github.com/hetznercloud/hcloud-go/v2 v2.10.2 h1:9gyTUPhfNbfbS40Spgij5mV5k37bOZgt
github.com/hetznercloud/hcloud-go/v2 v2.10.2/go.mod h1:xQ+8KhIS62W0D78Dpi57jsufWh844gUw1az5OUvaeq8=
github.com/hetznercloud/hcloud-go/v2 v2.11.0 h1:U1wD58/trMnKO6aHy2i2aguT5USwWbzC2hWj3r2sidE=
github.com/hetznercloud/hcloud-go/v2 v2.11.0/go.mod h1:dhix40Br3fDiBhwaSG/zgaYOFFddpfBm/6R1Zz0IiF0=
+github.com/hetznercloud/hcloud-go/v2 v2.12.0 h1:nOgfNTo0gyXZJJdM8mo/XH5MO/e80wAEpldRzdWayhY=
+github.com/hetznercloud/hcloud-go/v2 v2.12.0/go.mod h1:dhix40Br3fDiBhwaSG/zgaYOFFddpfBm/6R1Zz0IiF0=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
diff --git a/internal/api/volume_test.go b/internal/api/volume_test.go
index fe776c4e..bc0e44c8 100644
--- a/internal/api/volume_test.go
+++ b/internal/api/volume_test.go
@@ -25,7 +25,7 @@ func makeTestVolumeService(t *testing.T, requests []mockutil.Request) (*VolumeSe
testClient := hcloud.NewClient(
hcloud.WithEndpoint(testServer.URL),
hcloud.WithRetryOpts(hcloud.RetryOpts{BackoffFunc: hcloud.ConstantBackoff(0), MaxRetries: 3}),
- hcloud.WithPollBackoffFunc(hcloud.ConstantBackoff(0)),
+ hcloud.WithPollOpts(hcloud.PollOpts{BackoffFunc: hcloud.ConstantBackoff(0)}),
)
volumeService := NewVolumeService(log.NewNopLogger(), testClient)
diff --git a/internal/app/app.go b/internal/app/app.go
index 19baa66d..075515e5 100644
--- a/internal/app/app.go
+++ b/internal/app/app.go
@@ -148,7 +148,9 @@ func CreateHcloudClient(metricsRegistry *prometheus.Registry, logger log.Logger)
pollingInterval = tmp
}
- opts = append(opts, hcloud.WithPollBackoffFunc(hcloud.ExponentialBackoff(2, time.Duration(pollingInterval)*time.Second)))
+ opts = append(opts, hcloud.WithPollOpts(hcloud.PollOpts{
+ BackoffFunc: hcloud.ExponentialBackoff(2, time.Duration(pollingInterval)*time.Second),
+ }))
return hcloud.NewClient(opts...), nil
}