Skip to content

Commit 69651c4

Browse files
Merge pull request #469 from stuggi/golang_1.24
[golang] bump to golang 1.24
2 parents 71fb50a + 8cc0065 commit 69651c4

36 files changed

+270
-371
lines changed

.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-ovn-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: ovn
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: ovn
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: ovn
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
@@ -54,7 +54,7 @@ OPERATOR_SDK_VERSION ?= v1.31.0
5454
DEFAULT_IMG ?= quay.io/openstack-k8s-operators/ovn-operator:latest
5555
IMG ?= $(DEFAULT_IMG)
5656
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
57-
ENVTEST_K8S_VERSION = 1.29
57+
ENVTEST_K8S_VERSION = 1.31
5858

5959
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6060
ifeq (,$(shell go env GOBIN))
@@ -71,7 +71,7 @@ SHELL = /usr/bin/env bash -o pipefail
7171
# Extra vars which will be passed to the Docker-build
7272
DOCKER_BUILD_ARGS ?=
7373

74-
GOTOOLCHAIN_VERSION ?= go1.21.0
74+
GOTOOLCHAIN_VERSION ?= go1.24.0
7575
.PHONY: all
7676
all: build
7777

@@ -116,9 +116,10 @@ tidy: ## Run go mod tidy on every mod file in the repo
116116
go mod tidy
117117
cd ./api && go mod tidy
118118

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

124125
PROCS?=$(shell expr $(shell nproc --ignore 2) / 2)
@@ -207,7 +208,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo
207208

208209
## Tool Versions
209210
KUSTOMIZE_VERSION ?= v3.8.7
210-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
211+
CONTROLLER_TOOLS_VERSION ?= v0.18.0
211212

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

234235
.PHONY: ginkgo
235236
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.

api/bases/ovn.openstack.org_ovncontrollers.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: ovncontrollers.ovn.openstack.org
88
spec:
99
group: ovn.openstack.org
@@ -123,11 +123,9 @@ spec:
123123
Claims lists the names of resources, defined in spec.resourceClaims,
124124
that are used by this container.
125125
126-
127126
This is an alpha field and requires enabling the
128127
DynamicResourceAllocation feature gate.
129128
130-
131129
This field is immutable. It can only be set for containers.
132130
items:
133131
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -138,6 +136,12 @@ spec:
138136
the Pod where this field is used. It makes that resource available
139137
inside a container.
140138
type: string
139+
request:
140+
description: |-
141+
Request is the name chosen for a request in the referenced claim.
142+
If empty, everything from the claim is made available, otherwise
143+
only the result of this request.
144+
type: string
141145
required:
142146
- name
143147
type: object

api/bases/ovn.openstack.org_ovndbclusters.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: ovndbclusters.ovn.openstack.org
88
spec:
99
group: ovn.openstack.org
@@ -116,7 +116,7 @@ spec:
116116
Annotations is an unstructured key value map stored with a resource that may be
117117
set by external tools to store and retrieve arbitrary metadata. They are not
118118
queryable and should be preserved when modifying objects.
119-
More info: http://kubernetes.io/docs/user-guide/annotations
119+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
120120
type: object
121121
labels:
122122
additionalProperties:
@@ -125,7 +125,7 @@ spec:
125125
Map of string keys and values that can be used to organize and categorize
126126
(scope and select) objects. May match selectors of replication controllers
127127
and services.
128-
More info: http://kubernetes.io/docs/user-guide/labels
128+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
129129
type: object
130130
type: object
131131
spec:
@@ -270,11 +270,9 @@ spec:
270270
Claims lists the names of resources, defined in spec.resourceClaims,
271271
that are used by this container.
272272
273-
274273
This is an alpha field and requires enabling the
275274
DynamicResourceAllocation feature gate.
276275
277-
278276
This field is immutable. It can only be set for containers.
279277
items:
280278
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -285,6 +283,12 @@ spec:
285283
the Pod where this field is used. It makes that resource available
286284
inside a container.
287285
type: string
286+
request:
287+
description: |-
288+
Request is the name chosen for a request in the referenced claim.
289+
If empty, everything from the claim is made available, otherwise
290+
only the result of this request.
291+
type: string
288292
required:
289293
- name
290294
type: object

0 commit comments

Comments
 (0)