From 471aed2d4c1818e893ecaab66b14f9afad0718de Mon Sep 17 00:00:00 2001 From: Witold Konior Date: Fri, 2 Jan 2026 14:27:12 +0100 Subject: [PATCH 1/6] NOJIRA: update go. --- .github/workflows/build.yaml | 2 +- .github/workflows/golangci-lint.yaml | 2 +- go.mod | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9424d9a..30f5a45 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: 1.23.8 + go-version: 1.24.9 - name: Cache Go modules uses: actions/cache@v4 diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 8af8c6b..176d242 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: 1.23 + go-version: 1.24 - uses: actions/checkout@v4 - name: Run govulncheck diff --git a/go.mod b/go.mod index 0929c26..458d0c5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/castai/spot-handler -go 1.24.4 +go 1.24.9 require ( cloud.google.com/go/compute/metadata v0.6.0 @@ -13,6 +13,7 @@ require ( k8s.io/api v0.32.1 k8s.io/apimachinery v0.32.2 k8s.io/client-go v0.32.1 + k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e sigs.k8s.io/controller-runtime v0.20.4 ) @@ -61,7 +62,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect - k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e // indirect sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect From 7aae6f36ac9da9c606e3625766491ee684c4e440 Mon Sep 17 00:00:00 2001 From: Witold Konior Date: Fri, 2 Jan 2026 15:33:00 +0100 Subject: [PATCH 2/6] Upgrade to latest go version. --- .github/workflows/build.yaml | 2 +- .github/workflows/golangci-lint.yaml | 2 +- go.mod | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 30f5a45..eab7f0b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: 1.24.9 + go-version: 1.25.5 - name: Cache Go modules uses: actions/cache@v4 diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 176d242..69d3352 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: 1.24 + go-version: 1.25 - uses: actions/checkout@v4 - name: Run govulncheck diff --git a/go.mod b/go.mod index 458d0c5..a07f75b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/castai/spot-handler -go 1.24.9 +go 1.25.5 require ( cloud.google.com/go/compute/metadata v0.6.0 From 73b27904d6c216cb0dbac9b3ca57958ffd107197 Mon Sep 17 00:00:00 2001 From: Witold Konior Date: Tue, 13 Jan 2026 13:13:35 +0100 Subject: [PATCH 3/6] Upgrade the golangci-lint. --- .github/workflows/golangci-lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 69d3352..3f6036d 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -20,7 +20,7 @@ jobs: go-package: ./... - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - args: --timeout=5m + args: --timeout=5m --out-format=colored-line-number skip-pkg-cache: true From 27d395ff6dad62ae2e2c2fae3024324bd0daad33 Mon Sep 17 00:00:00 2001 From: Witold Konior Date: Tue, 13 Jan 2026 13:17:35 +0100 Subject: [PATCH 4/6] Upgrade golanci-lint. --- .github/workflows/golangci-lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 3f6036d..13ad6d0 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -20,7 +20,7 @@ jobs: go-package: ./... - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v9 with: args: --timeout=5m --out-format=colored-line-number - skip-pkg-cache: true + skip-cache: true From 377d2f6d7e2fa27d310aa0281006125286a8eae4 Mon Sep 17 00:00:00 2001 From: Witold Konior Date: Tue, 13 Jan 2026 13:22:20 +0100 Subject: [PATCH 5/6] Clean args for golangci-lint. --- .github/workflows/golangci-lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index 13ad6d0..eeeb73f 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -22,5 +22,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v9 with: - args: --timeout=5m --out-format=colored-line-number + args: --timeout=5m skip-cache: true From 1ab93ca3b4b6308c3a3987e29722b18235d30b0d Mon Sep 17 00:00:00 2001 From: Witold Konior Date: Tue, 13 Jan 2026 13:25:11 +0100 Subject: [PATCH 6/6] Fix linter error check. --- handler/aws_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handler/aws_test.go b/handler/aws_test.go index df1e103..9eb809d 100644 --- a/handler/aws_test.go +++ b/handler/aws_test.go @@ -18,7 +18,8 @@ func TestAwsInterruptChecker(t *testing.T) { router.HandleFunc("/latest/api/token", func(writer http.ResponseWriter, request *http.Request) { writer.Header().Set("X-aws-ec2-metadata-token-ttl-seconds", "1000") - fmt.Fprintf(writer, "TOKEN") + _, err := fmt.Fprintf(writer, "TOKEN") + require.NoError(t, err) }) router.HandleFunc("/latest/meta-data/spot/instance-action", func(writer http.ResponseWriter, request *http.Request) { action := ec2metadata.InstanceAction{