From b4c12cfb5d03062f8bf146a3bfd78d237184bdf0 Mon Sep 17 00:00:00 2001 From: Slava Ezhkin Date: Fri, 24 Jul 2026 17:36:05 +0200 Subject: [PATCH] Migrate to Go 1.26 Bump the go directive to 1.26.0 and golang base images to 1.26. Switch gomodguard to gomodguard_v2 in the linter config. golang.org/x/exp becomes an indirect dependency and mockery output picks up go1.26 formatting. --- .golangci.yaml | 2 +- go.mod | 4 ++-- images/controller/slurmctld.dockerfile | 2 +- images/soperator-controllers/Dockerfile | 2 +- internal/slurmapi/fake/mock_client.go | 4 +--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index e39931526..4d730720c 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -15,7 +15,7 @@ linters: - gocheckcompilerdirectives # Verify compiler directives like //go:generate. - goheader # Check presence and format of copyright headers. - gomoddirectives # Enforce rules for go.mod files (replace/retract directives). - - gomodguard # Control package imports. + - gomodguard_v2 # Control package imports. - goprintffuncname # Enforce consistent printf-like function naming conventions. - grouper # Group related constant/variable/import/type declarations. - inamedparam # Reports interfaces with unnamed method parameters. diff --git a/go.mod b/go.mod index 96bc9dc58..82f706413 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module nebius.ai/slurm-operator -go 1.25.1 +go 1.26.0 require ( github.com/SlinkyProject/slurm-client v0.3.1-20250801102150-043094ce1e4e @@ -25,7 +25,6 @@ require ( github.com/zclconf/go-cty v1.17.0 go.uber.org/zap v1.27.1 golang.org/x/crypto v0.46.0 - golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 google.golang.org/grpc v1.79.3 istio.io/pkg v0.0.0-20241216214326-d70796207df3 k8s.io/api v0.34.3 @@ -101,6 +100,7 @@ require ( go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect golang.org/x/mod v0.30.0 // indirect golang.org/x/sync v0.19.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect diff --git a/images/controller/slurmctld.dockerfile b/images/controller/slurmctld.dockerfile index 22e4ded4b..af9817eea 100644 --- a/images/controller/slurmctld.dockerfile +++ b/images/controller/slurmctld.dockerfile @@ -2,7 +2,7 @@ ARG SLURM_VERSION -FROM cr.eu-north1.nebius.cloud/soperator-proxy-docker-io/library/golang:1.25 AS go-base +FROM cr.eu-north1.nebius.cloud/soperator-proxy-docker-io/library/golang:1.26 AS go-base WORKDIR /build diff --git a/images/soperator-controllers/Dockerfile b/images/soperator-controllers/Dockerfile index de89a0d5f..5a4979af3 100644 --- a/images/soperator-controllers/Dockerfile +++ b/images/soperator-controllers/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker.io/docker/dockerfile-upstream:1.20.0 -FROM cr.eu-north1.nebius.cloud/soperator-proxy-docker-io/library/golang:1.25 AS soperator-go-base +FROM cr.eu-north1.nebius.cloud/soperator-proxy-docker-io/library/golang:1.26 AS soperator-go-base WORKDIR /build diff --git a/internal/slurmapi/fake/mock_client.go b/internal/slurmapi/fake/mock_client.go index 88b510078..c147f1d19 100644 --- a/internal/slurmapi/fake/mock_client.go +++ b/internal/slurmapi/fake/mock_client.go @@ -6,11 +6,9 @@ import ( context "context" io "io" + v0041 "github.com/SlinkyProject/slurm-client/api/v0041" mock "github.com/stretchr/testify/mock" - slurmapi "nebius.ai/slurm-operator/internal/slurmapi" - - v0041 "github.com/SlinkyProject/slurm-client/api/v0041" ) // MockClient is an autogenerated mock type for the Client type