Skip to content

Commit e44ab35

Browse files
committed
chore: Update Go version from 1.21 to 1.25.3
- Update go.mod to Go 1.25.3 - Update Dockerfile to use golang:1.25-alpine - Update CI workflow to Go 1.25 with test matrix [1.24, 1.25] - Update release workflow to Go 1.25 - Update Makefile GO_VERSION to 1.25 - Update validate-go-version.sh to handle patch versions
1 parent 95740e7 commit e44ab35

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- main
1212

1313
env:
14-
GO_VERSION: '1.21'
14+
GO_VERSION: '1.25'
1515
REGISTRY: docker.io/supporttools
1616

1717
jobs:
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
strategy:
4343
matrix:
44-
go-version: ['1.21', '1.22']
44+
go-version: ['1.24', '1.25']
4545
steps:
4646
- name: Checkout code
4747
uses: actions/checkout@v4
@@ -74,7 +74,7 @@ jobs:
7474
fi
7575
7676
- name: Upload coverage to Codecov
77-
if: matrix.go-version == '1.22'
77+
if: matrix.go-version == '1.25'
7878
uses: codecov/codecov-action@v4
7979
with:
8080
files: ./coverage.out,./coverage-integration.out

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
id-token: write
1212

1313
env:
14-
GO_VERSION: "1.21"
14+
GO_VERSION: "1.25"
1515
REGISTRY: docker.io
1616
IMAGE_NAME: supporttools/node-doctor
1717

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Optimized multi-stage build for minimal production image (<50MB target)
33

44
# Build stage
5-
FROM golang:1.21-alpine AS builder
5+
FROM golang:1.25-alpine AS builder
66

77
# Install build dependencies (git for go mod download)
88
RUN apk add --no-cache git

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ REGISTRY := docker.io/supporttools
3939
VERSION := $(shell date +%s)
4040
GIT_COMMIT := $(shell git rev-parse HEAD)
4141
BUILD_TIME := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
42-
GO_VERSION := 1.21
42+
GO_VERSION := 1.25
4343

4444
# RC Version - for release candidate builds
4545
RC_VERSION_FILE := .version-rc

go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module github.com/supporttools/node-doctor
22

3-
go 1.21
3+
go 1.25.3
44

55
require (
66
github.com/fsnotify/fsnotify v1.7.0
77
github.com/prometheus/client_golang v1.17.0
88
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16
9-
github.com/stretchr/testify v1.8.2
109
golang.org/x/net v0.13.0
10+
gopkg.in/yaml.v2 v2.4.0
1111
gopkg.in/yaml.v3 v3.0.1
1212
k8s.io/api v0.28.0
1313
k8s.io/apimachinery v0.28.0
@@ -39,7 +39,6 @@ require (
3939
github.com/modern-go/reflect2 v1.0.2 // indirect
4040
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4141
github.com/pkg/errors v0.9.1 // indirect
42-
github.com/pmezard/go-difflib v1.0.0 // indirect
4342
github.com/prometheus/common v0.44.0 // indirect
4443
github.com/prometheus/procfs v0.11.1 // indirect
4544
github.com/spf13/pflag v1.0.5 // indirect
@@ -51,7 +50,6 @@ require (
5150
google.golang.org/appengine v1.6.7 // indirect
5251
google.golang.org/protobuf v1.31.0 // indirect
5352
gopkg.in/inf.v0 v0.9.1 // indirect
54-
gopkg.in/yaml.v2 v2.4.0 // indirect
5553
k8s.io/klog/v2 v2.100.1 // indirect
5654
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
5755
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect

scripts/validate-go-version.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -e
77

8-
REQUIRED_GO_VERSION="1.21"
8+
REQUIRED_GO_VERSION="1.25"
99
ERRORS=0
1010

1111
echo "Checking Go version in all go.mod files..."
@@ -21,9 +21,12 @@ while IFS= read -r mod_file; do
2121
continue
2222
fi
2323

24-
# Compare versions
25-
if [ "$go_version" != "$REQUIRED_GO_VERSION" ] && [ "$go_version" != "${REQUIRED_GO_VERSION}.0" ]; then
26-
echo "ERROR: $mod_file has Go version $go_version, expected $REQUIRED_GO_VERSION"
24+
# Compare versions - allow patch versions (e.g., 1.25.3 matches 1.25)
25+
# Extract major.minor from the go.mod version
26+
go_version_minor=$(echo "$go_version" | grep -oE "^[0-9]+\.[0-9]+")
27+
28+
if [ "$go_version_minor" != "$REQUIRED_GO_VERSION" ]; then
29+
echo "ERROR: $mod_file has Go version $go_version, expected $REQUIRED_GO_VERSION or $REQUIRED_GO_VERSION.x"
2730
ERRORS=$((ERRORS + 1))
2831
else
2932
echo "$mod_file: Go $go_version"

0 commit comments

Comments
 (0)