Skip to content

Commit df3b820

Browse files
Merge pull request #544 from stuggi/golang_1.24
[golang] bump to golang 1.24
2 parents 7cfe04e + 4b0fb88 commit df3b820

21 files changed

Lines changed: 370 additions & 329 deletions

.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
build_root_image:
22
name: tools
33
namespace: openstack-k8s-operators
4-
tag: ci-build-root-golang-1.21-sdk-1.31
4+
tag: ci-build-root-golang-1.24-sdk-1.31

.github/workflows/build-neutron-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/reusable-build-operator.yaml@main
1616
with:
1717
operator_name: neutron
18-
go_version: 1.21.x
18+
go_version: 1.24.x
1919
operator_sdk_version: 1.31.0
2020
secrets:
2121
IMAGENAMESPACE: ${{ secrets.IMAGENAMESPACE }}

.github/workflows/force-bump-pr-manual.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ jobs:
99
with:
1010
operator_name: neutron
1111
branch_name: ${{ github.ref_name }}
12+
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
1213
secrets:
1314
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}

.github/workflows/force-bump-pr-scheduled.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ jobs:
1010
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/force-bump-branches.yaml@main
1111
with:
1212
operator_name: neutron
13+
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
1314
secrets:
1415
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}

.golangci.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
version: 2
2+
13
linters:
24
# Enable specific linter
35
# https://golangci-lint.run/usage/linters/#enabled-by-default
46
enable:
57
- errorlint
68
- revive
79
- ginkgolinter
8-
- gofmt
910
- govet
1011
- gosec
1112
- errname
1213
- err113
14+
15+
formatters:
16+
enable:
17+
- gofmt
18+
1319
run:
1420
timeout: 5m
15-
16-
issues:
17-
exclude-rules:
18-
- path: '(.+)_test\.go'
19-
linters:
20-
- gosec

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ repos:
7979
# E012: here doc didn't end before EOF
8080

8181
- repo: https://github.com/golangci/golangci-lint
82-
rev: v1.59.1
82+
rev: v2.4.0
8383
hooks:
8484
- id: golangci-lint-full
8585
args: ["-v"]

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.21
2+
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.24
33
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-minimal:latest
44

55
FROM $GOLANG_BUILDER AS builder

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ OPERATOR_SDK_VERSION ?= v1.31.0
5353
# Image URL to use all building/pushing image targets
5454
IMG ?= quay.io/openstack-k8s-operators/neutron-operator:latest
5555
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
56-
ENVTEST_K8S_VERSION = 1.29
56+
ENVTEST_K8S_VERSION = 1.31
5757

5858
# Set minimum Go version
59-
GOTOOLCHAIN_VERSION ?= go1.21.0
59+
GOTOOLCHAIN_VERSION ?= go1.24.0
6060

6161
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6262
ifeq (,$(shell go env GOBIN))
@@ -119,9 +119,10 @@ tidy: ## Run go mod tidy on every mod file in the repo
119119
go mod tidy
120120
cd ./api && go mod tidy
121121

122+
GOLANGCI_LINT_VERSION ?= v2.4.0
122123
.PHONY: golangci-lint
123124
golangci-lint:
124-
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
125+
test -s $(LOCALBIN)/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $(GOLANGCI_LINT_VERSION)
125126
$(LOCALBIN)/golangci-lint run --fix
126127

127128
PROCS?=$(shell expr $(shell nproc --ignore 2) / 2)
@@ -208,7 +209,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo
208209

209210
## Tool Versions
210211
KUSTOMIZE_VERSION ?= v3.8.7
211-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
212+
CONTROLLER_TOOLS_VERSION ?= v0.18.0
212213

213214
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
214215
.PHONY: kustomize
@@ -230,7 +231,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
230231
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
231232
$(ENVTEST): $(LOCALBIN)
232233
# TODO: revisit pinned version once https://github.com/kubernetes-sigs/controller-runtime/issues/2720 is fixed
233-
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@c7e1dc9
234+
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
234235

235236
.PHONY: operator-sdk
236237
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk

api/bases/neutron.openstack.org_neutronapis.yaml

Lines changed: 87 additions & 24 deletions
Large diffs are not rendered by default.

api/go.mod

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
module github.com/openstack-k8s-operators/neutron-operator/api
22

3-
go 1.21
3+
go 1.24
44

55
require (
6-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250909143828-e33d35ffd64f
7-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250823121217-7e1cd2e3dd03
8-
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20250823121217-7e1cd2e3dd03
9-
k8s.io/api v0.29.15
10-
k8s.io/apimachinery v0.29.15
11-
sigs.k8s.io/controller-runtime v0.17.6
6+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250922155301-057562fb7182
7+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250922082314-c83d83092a04
8+
github.com/openstack-k8s-operators/lib-common/modules/storage v0.6.1-0.20250922082314-c83d83092a04
9+
k8s.io/api v0.31.12
10+
k8s.io/apimachinery v0.31.12
11+
sigs.k8s.io/controller-runtime v0.19.7
1212
)
1313

1414
require (
1515
github.com/beorn7/perks v1.0.1 // indirect
16-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
16+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
1717
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1818
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
1919
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
2020
github.com/fsnotify/fsnotify v1.7.0 // indirect
21+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
2122
github.com/go-logr/logr v1.4.3 // indirect
2223
github.com/go-openapi/jsonpointer v0.21.0 // indirect
2324
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -37,35 +38,34 @@ require (
3738
github.com/modern-go/reflect2 v1.0.2 // indirect
3839
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3940
github.com/pkg/errors v0.9.1 // indirect
40-
github.com/prometheus/client_golang v1.19.0 // indirect
41-
github.com/prometheus/client_model v0.6.0 // indirect
42-
github.com/prometheus/common v0.51.1 // indirect
43-
github.com/prometheus/procfs v0.13.0 // indirect
41+
github.com/prometheus/client_golang v1.19.1 // indirect
42+
github.com/prometheus/client_model v0.6.1 // indirect
43+
github.com/prometheus/common v0.55.0 // indirect
44+
github.com/prometheus/procfs v0.15.1 // indirect
4445
github.com/spf13/pflag v1.0.5 // indirect
46+
github.com/x448/float16 v0.8.4 // indirect
4547
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
4648
golang.org/x/net v0.28.0 // indirect
47-
golang.org/x/oauth2 v0.18.0 // indirect
49+
golang.org/x/oauth2 v0.21.0 // indirect
4850
golang.org/x/sys v0.23.0 // indirect
4951
golang.org/x/term v0.23.0 // indirect
5052
golang.org/x/text v0.17.0 // indirect
5153
golang.org/x/time v0.5.0 // indirect
5254
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
53-
google.golang.org/appengine v1.6.8 // indirect
54-
google.golang.org/protobuf v1.34.1 // indirect
55+
google.golang.org/protobuf v1.34.2 // indirect
5556
gopkg.in/inf.v0 v0.9.1 // indirect
5657
gopkg.in/yaml.v2 v2.4.0 // indirect
5758
gopkg.in/yaml.v3 v3.0.1 // indirect
58-
k8s.io/apiextensions-apiserver v0.29.15 // indirect
59-
k8s.io/client-go v0.29.15 // indirect
60-
k8s.io/component-base v0.29.15 // indirect
61-
k8s.io/klog/v2 v2.120.1 // indirect
59+
k8s.io/apiextensions-apiserver v0.31.12 // indirect
60+
k8s.io/client-go v0.31.12 // indirect
61+
k8s.io/klog/v2 v2.130.1 // indirect
6262
k8s.io/kube-openapi v0.0.0-20240322212309-b815d8309940 // indirect
63-
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
63+
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d // indirect
6464
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
6565
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
6666
sigs.k8s.io/yaml v1.4.0 // indirect
6767
)
6868

69-
// mschuppert: map to latest commit from release-4.16 tag
69+
// mschuppert: map to latest commit from release-4.18 tag
7070
// must consistent within modules and service operators
71-
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094 //allow-merging
71+
replace github.com/openshift/api => github.com/openshift/api v0.0.0-20250711200046-c86d80652a9e //allow-merging

0 commit comments

Comments
 (0)