From 64aa9ce1bd7f112982a34302a3bdeb63282eccd3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:41:34 +0200 Subject: [PATCH] deps: update module github.com/hetznercloud/hcloud-go/v2 to v2.11.0 (#821) 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.10.2` -> `v2.11.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fhetznercloud%2fhcloud-go%2fv2/v2.11.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.11.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.10.2/v2.11.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.10.2/v2.11.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2) ### [`v2.11.0`](https://togithub.com/hetznercloud/hcloud-go/releases/tag/v2.11.0) [Compare Source](https://togithub.com/hetznercloud/hcloud-go/compare/v2.10.2...v2.11.0) ##### Features - add truncated exponential backoff with full jitter ([#​459](https://togithub.com/hetznercloud/hcloud-go/issues/459)) ([fd1f46c](https://togithub.com/hetznercloud/hcloud-go/commit/fd1f46cc35e61dde1e524399eef88c38a757636e)) - allow configuring retry options ([#​488](https://togithub.com/hetznercloud/hcloud-go/issues/488)) ([2db9575](https://togithub.com/hetznercloud/hcloud-go/commit/2db95753e2c826aeafa3bd9b864e95efd89ace7f)) - **exp:** add sliceutil package ([#​489](https://togithub.com/hetznercloud/hcloud-go/issues/489)) ([f4ad6bc](https://togithub.com/hetznercloud/hcloud-go/commit/f4ad6bc93ff5017dda1b71a1606b67a79b56eb57)) - **exp:** rename `*utils` package to `*util` ([#​487](https://togithub.com/hetznercloud/hcloud-go/issues/487)) ([19da475](https://togithub.com/hetznercloud/hcloud-go/commit/19da4759f4cbee7ed94ed6996350b45650f8b0b9)) - respect cancelled contexts during retry sleep ([#​470](https://togithub.com/hetznercloud/hcloud-go/issues/470)) ([756f605](https://togithub.com/hetznercloud/hcloud-go/commit/756f605c97ac570adec531a479fc61c1ed27ab72)) - retry requests when the api gateway errors ([#​470](https://togithub.com/hetznercloud/hcloud-go/issues/470)) ([756f605](https://togithub.com/hetznercloud/hcloud-go/commit/756f605c97ac570adec531a479fc61c1ed27ab72)) - retry requests when the network timed out ([#​470](https://togithub.com/hetznercloud/hcloud-go/issues/470)) ([756f605](https://togithub.com/hetznercloud/hcloud-go/commit/756f605c97ac570adec531a479fc61c1ed27ab72)) - retry requests when the rate limit was reached ([#​470](https://togithub.com/hetznercloud/hcloud-go/issues/470)) ([756f605](https://togithub.com/hetznercloud/hcloud-go/commit/756f605c97ac570adec531a479fc61c1ed27ab72)) ##### Bug Fixes - **exp:** set capacity for each batch ([#​490](https://togithub.com/hetznercloud/hcloud-go/issues/490)) ([57f53c1](https://togithub.com/hetznercloud/hcloud-go/commit/57f53c1dca54ee79a33bab35740e7de7ece3b75f))
--- ### 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/cli). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo --- go.mod | 4 ++-- go.sum | 8 ++++---- internal/cmd/base/delete.go | 3 ++- internal/cmd/server/create.go | 4 ++-- internal/cmd/util/slices.go | 8 -------- internal/cmd/util/slices_test.go | 17 ----------------- internal/cmd/volume/create.go | 4 ++-- 7 files changed, 12 insertions(+), 36 deletions(-) delete mode 100644 internal/cmd/util/slices.go delete mode 100644 internal/cmd/util/slices_test.go diff --git a/go.mod b/go.mod index d87d98a2..cfa26d7e 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/goccy/go-yaml v1.12.0 github.com/golang/mock v1.6.0 github.com/guptarohit/asciigraph v0.7.1 - github.com/hetznercloud/hcloud-go/v2 v2.10.2 + github.com/hetznercloud/hcloud-go/v2 v2.11.0 github.com/jedib0t/go-pretty/v6 v6.5.9 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.1 @@ -52,7 +52,7 @@ require ( go.uber.org/multierr v1.9.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.27.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/go.sum b/go.sum index e0d327a0..2f1f6b05 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/guptarohit/asciigraph v0.7.1 h1:K+JWbRc04XEfv8BSZgNuvhCmpbvX4+9NYd/Ux github.com/guptarohit/asciigraph v0.7.1/go.mod h1:dYl5wwK4gNsnFf9Zp+l06rFiDZ5YtXM6x7SRWZ3KGag= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hetznercloud/hcloud-go/v2 v2.10.2 h1:9gyTUPhfNbfbS40Spgij5mV5k37bOZgt8iHKCbfGs5I= -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/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jedib0t/go-pretty/v6 v6.5.9 h1:ACteMBRrrmm1gMsXe9PSTOClQ63IXDUt03H5U+UV8OU= @@ -131,8 +131,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -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/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/internal/cmd/base/delete.go b/internal/cmd/base/delete.go index d1fb37cd..ea6b00fe 100644 --- a/internal/cmd/base/delete.go +++ b/internal/cmd/base/delete.go @@ -12,6 +12,7 @@ import ( "github.com/hetznercloud/cli/internal/hcapi2" "github.com/hetznercloud/cli/internal/state" "github.com/hetznercloud/hcloud-go/v2/hcloud" + "github.com/hetznercloud/hcloud-go/v2/hcloud/exp/kit/sliceutil" ) // DeleteCmd allows defining commands for deleting a resource. @@ -58,7 +59,7 @@ func (dc *DeleteCmd) Run(s state.State, cmd *cobra.Command, args []string) error errs := make([]error, 0, len(args)) deleted := make([]string, 0, len(args)) - for _, batch := range util.Batches(args, deleteBatchSize) { + for _, batch := range sliceutil.Batches(args, deleteBatchSize) { results := make([]util.ResourceState, len(batch)) actions := make([]*hcloud.Action, 0, len(batch)) diff --git a/internal/cmd/server/create.go b/internal/cmd/server/create.go index 15a2c305..62d5c833 100644 --- a/internal/cmd/server/create.go +++ b/internal/cmd/server/create.go @@ -20,7 +20,7 @@ import ( "github.com/hetznercloud/cli/internal/state" "github.com/hetznercloud/cli/internal/state/config" "github.com/hetznercloud/hcloud-go/v2/hcloud" - "github.com/hetznercloud/hcloud-go/v2/hcloud/exp/actionutils" + "github.com/hetznercloud/hcloud-go/v2/hcloud/exp/actionutil" "github.com/hetznercloud/hcloud-go/v2/hcloud/schema" ) @@ -109,7 +109,7 @@ var CreateCmd = base.CreateCmd{ return nil, nil, err } - if err := s.WaitForActions(cmd, s, actionutils.AppendNext(result.Action, result.NextActions)...); err != nil { + if err := s.WaitForActions(cmd, s, actionutil.AppendNext(result.Action, result.NextActions)...); err != nil { return nil, nil, err } diff --git a/internal/cmd/util/slices.go b/internal/cmd/util/slices.go deleted file mode 100644 index 924565e9..00000000 --- a/internal/cmd/util/slices.go +++ /dev/null @@ -1,8 +0,0 @@ -package util - -func Batches[T any](all []T, size int) (batches [][]T) { - for size < len(all) { - all, batches = all[size:], append(batches, all[:size]) - } - return append(batches, all) -} diff --git a/internal/cmd/util/slices_test.go b/internal/cmd/util/slices_test.go deleted file mode 100644 index dc176fe7..00000000 --- a/internal/cmd/util/slices_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestBatches(t *testing.T) { - all := []int{1, 2, 3, 4, 5} - batches := Batches(all, 2) - - assert.Len(t, batches, 3) - assert.Equal(t, []int{1, 2}, batches[0]) - assert.Equal(t, []int{3, 4}, batches[1]) - assert.Equal(t, []int{5}, batches[2]) -} diff --git a/internal/cmd/volume/create.go b/internal/cmd/volume/create.go index 3eeef94e..39873ca1 100644 --- a/internal/cmd/volume/create.go +++ b/internal/cmd/volume/create.go @@ -12,7 +12,7 @@ import ( "github.com/hetznercloud/cli/internal/hcapi2" "github.com/hetznercloud/cli/internal/state" "github.com/hetznercloud/hcloud-go/v2/hcloud" - "github.com/hetznercloud/hcloud-go/v2/hcloud/exp/actionutils" + "github.com/hetznercloud/hcloud-go/v2/hcloud/exp/actionutil" ) var CreateCmd = base.CreateCmd{ @@ -98,7 +98,7 @@ var CreateCmd = base.CreateCmd{ return nil, nil, err } - if err := s.WaitForActions(cmd, s, actionutils.AppendNext(result.Action, result.NextActions)...); err != nil { + if err := s.WaitForActions(cmd, s, actionutil.AppendNext(result.Action, result.NextActions)...); err != nil { return nil, nil, err } cmd.Printf("Volume %d created\n", result.Volume.ID)