Skip to content

[golang] bump to golang 1.24 #1567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: tools
namespace: openstack-k8s-operators
tag: ci-build-root-golang-1.21-sdk-1.31
tag: ci-build-root-golang-1.24-sdk-1.31
2 changes: 1 addition & 1 deletion .github/workflows/build-openstack-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/reusable-build-operator.yaml@main
with:
operator_name: openstack
go_version: 1.21.x
go_version: 1.24.x
operator_sdk_version: 1.31.0
bundle_dockerfile: ./bundle.Dockerfile
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.23.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/force-bump-pr-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ jobs:
with:
operator_name: openstack
branch_name: ${{ github.ref_name }}
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
secrets:
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}
1 change: 1 addition & 0 deletions .github/workflows/force-bump-pr-scheduled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ jobs:
uses: openstack-k8s-operators/openstack-k8s-operators-ci/.github/workflows/force-bump-branches.yaml@main
with:
operator_name: openstack
custom_image: quay.io/openstack-k8s-operators/openstack-k8s-operators-ci-build-tools:golang-1.24-sdk-1.31
secrets:
FORCE_BUMP_PULL_REQUEST_PAT: ${{ secrets.FORCE_BUMP_PULL_REQUEST_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/kustom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.23.x
- uses: actions/checkout@v4
with:
# this fetches all branches. Needed because we need gh-pages branch for deploy to work
Expand Down
8 changes: 7 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
version: 2

linters:
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- errorlint
- revive
- ginkgolinter
- gofmt
- govet

formatters:
enable:
- gofmt

run:
timeout: 5m
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ repos:
entry: bashate --error . --ignore=E006,E040,E011,E020,E012

- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v2.4.0
hooks:
- id: golangci-lint-full
args: ["-v"]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.21
ARG GOLANG_BUILDER=registry.access.redhat.com/ubi9/go-toolset:1.24
ARG OPERATOR_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi-minimal:latest
# Build the manager binary
FROM $GOLANG_BUILDER AS builder
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ OPERATOR_SDK_VERSION ?= v1.31.0
DEFAULT_IMG ?= quay.io/openstack-k8s-operators/openstack-operator:latest
IMG ?= $(DEFAULT_IMG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29
ENVTEST_K8S_VERSION = 1.31.0

CRDDESC_OVERRIDE ?= :maxDescLen=0

Expand Down Expand Up @@ -186,9 +186,10 @@ tidy: ## Run go mod tidy on every mod file in the repo
go mod tidy
cd ./apis && go mod tidy

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

MAX_PROCS := 5
Expand Down Expand Up @@ -309,10 +310,10 @@ KUTTL ?= $(LOCALBIN)/kubectl-kuttl

## Tool Versions
KUSTOMIZE_VERSION ?= v5.5.0 #(dprince: bumped to aquire new features like --load-restrictor)
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.18.0
CRD_MARKDOWN_VERSION ?= v0.0.3
KUTTL_VERSION ?= 0.17.0
GOTOOLCHAIN_VERSION ?= go1.21.0
GOTOOLCHAIN_VERSION ?= go1.24.0
OC_VERSION ?= 4.16.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
Expand All @@ -339,7 +340,7 @@ $(CRD_MARKDOWN): $(LOCALBIN)
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@c7e1dc9b
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: ginkgo
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary.
Expand Down
4 changes: 3 additions & 1 deletion apis/bases/client.openstack.org_openstackclients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.18.0
name: openstackclients.client.openstack.org
spec:
group: client.openstack.org
Expand Down Expand Up @@ -56,6 +56,7 @@ spec:
key:
type: string
name:
default: ""
type: string
optional:
type: boolean
Expand Down Expand Up @@ -94,6 +95,7 @@ spec:
key:
type: string
name:
default: ""
type: string
optional:
type: boolean
Expand Down
Loading