diff --git a/build/Dockerfile b/build/Dockerfile index 5a39abe9e8d2..d44e391d4b8e 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -4,7 +4,7 @@ FROM $BUILDIMAGE ARG TARGETARCH RUN set -ex; \ # Need to use the gold linker on ARM, Go really wants to have it. -# https://github.com/golang/go/blob/go1.22.4/src/cmd/link/internal/ld/lib.go#L1622-L1641 +# https://github.com/golang/go/blob/go1.23.2/src/cmd/link/internal/ld/lib.go##L1661-L1680 case "$TARGETARCH" in \ arm*) binutils=binutils-gold ;; \ *) binutils=binutils ;; \ diff --git a/embedded-bins/Makefile.variables b/embedded-bins/Makefile.variables index 88de7a89c58e..4d7912fda9ed 100644 --- a/embedded-bins/Makefile.variables +++ b/embedded-bins/Makefile.variables @@ -1,7 +1,7 @@ alpine_version = 3.20 alpine_patch_version = $(alpine_version).1 golang_buildimage=docker.io/library/golang:$(go_version)-alpine$(alpine_version) -go_version = 1.22.8 +go_version = 1.23.2 runc_version = 1.1.15 runc_buildimage = $(golang_buildimage) diff --git a/go.mod b/go.mod index 122def8de11d..4e0ed2955019 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/k0sproject/k0s -go 1.22.0 +go 1.23 // k0s require ( diff --git a/hack/tool/go.mod b/hack/tool/go.mod index dbc25bdd7e7e..68742756392e 100644 --- a/hack/tool/go.mod +++ b/hack/tool/go.mod @@ -1,6 +1,6 @@ module tool -go 1.22.0 +go 1.23 require ( github.com/hashicorp/terraform-exec v0.21.0 diff --git a/internal/http/download.go b/internal/http/download.go index 5d7009f95fc0..10ac0fd9a028 100644 --- a/internal/http/download.go +++ b/internal/http/download.go @@ -81,9 +81,6 @@ func Download(ctx context.Context, url string, target io.Writer, options ...Down // Execute the request. resp, err := client.Do(req.WithContext(ctx)) if err != nil { - if cause := context.Cause(ctx); cause != nil && !errors.Is(err, cause) { - err = fmt.Errorf("%w (%w)", cause, err) - } return fmt.Errorf("request failed: %w", err) } defer func() { @@ -111,10 +108,6 @@ func Download(ctx context.Context, url string, target io.Writer, options ...Down // Run the actual data transfer. if _, err := io.Copy(io.MultiWriter(writeMonitor, target), resp.Body); err != nil { - if cause := context.Cause(ctx); cause != nil && !errors.Is(err, cause) { - err = fmt.Errorf("%w (%w)", cause, err) - } - return fmt.Errorf("while downloading: %w", err) } diff --git a/internal/http/download_test.go b/internal/http/download_test.go index bb6de19a5a8a..79525949090f 100644 --- a/internal/http/download_test.go +++ b/internal/http/download_test.go @@ -44,11 +44,10 @@ func TestDownload_CancelRequest(t *testing.T) { cancel(assert.AnError) err := internalhttp.Download(ctx, "http://404.example.com", io.Discard) - assert.ErrorIs(t, err, assert.AnError) if urlErr := (*url.Error)(nil); assert.ErrorAs(t, err, &urlErr) { assert.Equal(t, "Get", urlErr.Op) assert.Equal(t, "http://404.example.com", urlErr.URL) - assert.Equal(t, context.Canceled, urlErr.Err) + assert.Equal(t, assert.AnError, urlErr.Err) } } @@ -113,7 +112,6 @@ func TestDownload_CancelDownload(t *testing.T) { assert.ErrorContains(t, err, "while downloading: ") assert.ErrorIs(t, err, assert.AnError) - assert.ErrorIs(t, err, context.Canceled) } func TestDownload_RedirectLoop(t *testing.T) {