From 901022de6982d9344b364aebecd927986a6aa725 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:43:03 +0200 Subject: [PATCH] deps: update module github.com/hetznercloud/hcloud-go/v2 to v2.10.1 (#645) 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.9.0` -> `v2.10.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.10.1?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.10.1?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.9.0/v2.10.1?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.9.0/v2.10.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2) ### [`v2.10.1`](https://togithub.com/hetznercloud/hcloud-go/releases/tag/v2.10.1) [Compare Source](https://togithub.com/hetznercloud/hcloud-go/compare/v2.10.0...v2.10.1) ##### Bug Fixes - **exp:** configure response headers before sending them ([#​473](https://togithub.com/hetznercloud/hcloud-go/issues/473)) ([07d4a35](https://togithub.com/hetznercloud/hcloud-go/commit/07d4a356dec0e2f44a6f3eec1ea3affec8932c22)) ### [`v2.10.0`](https://togithub.com/hetznercloud/hcloud-go/releases/tag/v2.10.0) [Compare Source](https://togithub.com/hetznercloud/hcloud-go/compare/v2.9.0...v2.10.0) ##### Features - **exp:** add envutils package ([#​466](https://togithub.com/hetznercloud/hcloud-go/issues/466)) ([a7636bd](https://togithub.com/hetznercloud/hcloud-go/commit/a7636bdcf5e4d55860f40da684c64cb72f8ddc03)) - **exp:** add labelutils with selector ([#​465](https://togithub.com/hetznercloud/hcloud-go/issues/465)) ([1a55a7e](https://togithub.com/hetznercloud/hcloud-go/commit/1a55a7ed65bffdbf73000ffcf1ef22c9e55650f8)) - **exp:** add mock utils package ([#​460](https://togithub.com/hetznercloud/hcloud-go/issues/460)) ([92f7c62](https://togithub.com/hetznercloud/hcloud-go/commit/92f7c624edfc76e06abe8c9c60e9c78d4b28f12f)) - **exp:** rename `AppendNextActions` to `AppendNext` ([#​452](https://togithub.com/hetznercloud/hcloud-go/issues/452)) ([9b6239a](https://togithub.com/hetznercloud/hcloud-go/commit/9b6239ad188e601f22bc28e0072603c07fea201c)) - filter out nil actions in action waiter ([#​464](https://togithub.com/hetznercloud/hcloud-go/issues/464)) ([4fc9a40](https://togithub.com/hetznercloud/hcloud-go/commit/4fc9a4039d45071124a435121642ca396a8237c0)) ##### Bug Fixes - nil check against the embedded `http.Response` ([#​469](https://togithub.com/hetznercloud/hcloud-go/issues/469)) ([46e489a](https://togithub.com/hetznercloud/hcloud-go/commit/46e489a1782e8477d1c5a234dc203fa356c2a583))
--- ### 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 has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](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 | 8 +++--- go.sum | 8 ++++++ internal/api/volume_test.go | 12 ++++----- internal/mocked/mocked.go | 54 ------------------------------------- 4 files changed, 18 insertions(+), 64 deletions(-) delete mode 100644 internal/mocked/mocked.go diff --git a/go.mod b/go.mod index 7e05a933..602a9d36 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.9.0 + github.com/hetznercloud/hcloud-go/v2 v2.10.1 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 @@ -37,9 +37,9 @@ require ( github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.48.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/text v0.15.0 // indirect - golang.org/x/tools v0.17.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index dbefb219..736c7670 100644 --- a/go.sum +++ b/go.sum @@ -54,6 +54,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/hetznercloud/hcloud-go/v2 v2.9.0 h1:s0N6R7Zoi2DPfMtUF5o9VeUBzTtHVY6MIkHOQnfu/AY= github.com/hetznercloud/hcloud-go/v2 v2.9.0/go.mod h1:qtW/TuU7Bs16ibXl/ktJarWqU2LwHr7eGlwoilHxtgg= +github.com/hetznercloud/hcloud-go/v2 v2.10.1 h1:MLfIJJvl7qo79Q+52YmrJ4BOTL5oICJWHjzb0sCtgQI= +github.com/hetznercloud/hcloud-go/v2 v2.10.1/go.mod h1:xQ+8KhIS62W0D78Dpi57jsufWh844gUw1az5OUvaeq8= 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= @@ -124,6 +126,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -144,6 +148,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -155,6 +161,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/api/volume_test.go b/internal/api/volume_test.go index 34d3b839..7e781627 100644 --- a/internal/api/volume_test.go +++ b/internal/api/volume_test.go @@ -10,18 +10,18 @@ import ( "github.com/stretchr/testify/assert" "github.com/hetznercloud/csi-driver/internal/csi" - "github.com/hetznercloud/csi-driver/internal/mocked" "github.com/hetznercloud/csi-driver/internal/volumes" "github.com/hetznercloud/hcloud-go/v2/hcloud" + "github.com/hetznercloud/hcloud-go/v2/hcloud/exp/mockutils" "github.com/hetznercloud/hcloud-go/v2/hcloud/schema" ) var _ volumes.Service = (*VolumeService)(nil) -func makeTestVolumeService(t *testing.T, requests []mocked.Request) (*VolumeService, func()) { +func makeTestVolumeService(t *testing.T, requests []mockutils.Request) (*VolumeService, func()) { t.Helper() - testServer := httptest.NewServer(mocked.Handler(t, requests)) + testServer := httptest.NewServer(mockutils.Handler(t, requests)) testClient := hcloud.NewClient( hcloud.WithEndpoint(testServer.URL), @@ -37,7 +37,7 @@ func makeTestVolumeService(t *testing.T, requests []mocked.Request) (*VolumeServ func TestResize(t *testing.T) { t.Run("ErrVolumeSizeAlreadyReached", func(t *testing.T) { t.Run("happy with larger volume size", func(t *testing.T) { - volumeService, cleanup := makeTestVolumeService(t, []mocked.Request{ + volumeService, cleanup := makeTestVolumeService(t, []mockutils.Request{ { Method: "GET", Path: "/volumes/1", Status: 200, @@ -60,7 +60,7 @@ func TestResize(t *testing.T) { }) t.Run("with equal volume size", func(t *testing.T) { - volumeService, cleanup := makeTestVolumeService(t, []mocked.Request{ + volumeService, cleanup := makeTestVolumeService(t, []mockutils.Request{ { Method: "GET", Path: "/volumes/1", Status: 200, @@ -76,7 +76,7 @@ func TestResize(t *testing.T) { }) t.Run("with smaller volume size", func(t *testing.T) { - volumeService, cleanup := makeTestVolumeService(t, []mocked.Request{ + volumeService, cleanup := makeTestVolumeService(t, []mockutils.Request{ { Method: "GET", Path: "/volumes/1", Status: 200, diff --git a/internal/mocked/mocked.go b/internal/mocked/mocked.go deleted file mode 100644 index ff99fe89..00000000 --- a/internal/mocked/mocked.go +++ /dev/null @@ -1,54 +0,0 @@ -package mocked - -import ( - "encoding/json" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -type Request struct { - Method string - Path string - PathRegexp string - - Status int - Body string - JSON any -} - -func Handler(t *testing.T, requests []Request) http.HandlerFunc { - t.Helper() - - index := 0 - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if index >= len(requests) { - t.Fatalf("received unknown request %d", index) - } - - response := requests[index] - assert.Equal(t, response.Method, r.Method) - if response.PathRegexp != "" { - require.Regexp(t, response.Path, r.RequestURI, "request %d", index) - } else { - require.Equal(t, response.Path, r.RequestURI, "request %d", index) - } - - w.WriteHeader(response.Status) - w.Header().Set("Content-Type", "application/json") - if response.Body != "" { - _, err := w.Write([]byte(response.Body)) - if err != nil { - t.Fatal(err) - } - } else if response.JSON != nil { - if err := json.NewEncoder(w).Encode(response.JSON); err != nil { - t.Fatal(err) - } - } - - index++ - }) -}