v1.41.0

Upgrade Go version to 1.24

Update the Go version used to 1.24. This affects:

Dockerfile:

- FROM golang:1.23 AS builder
+ FROM golang:1.24 AS builder

.devcontainer/devcontainer.json:

- "image": "golang:1.23",
+ "image": "golang:1.24",

go.mod:

- go 1.23.0
+ go 1.24.0

See #6954 for more details.

Upgrade golangci-lint and use v2 config

Update golangci-lint usage across the project:

Makefile:

- GOLANGCI_LINT_VERSION ?= v1.63.4
+ GOLANGCI_LINT_VERSION ?= v2.1.0

- $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
+ $(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

GitHub Actions Workflow:

- uses: golangci/golangci-lint-action@v6
+ uses: golangci/golangci-lint-action@v8

.golangci.yml:
Convert to v2 layout with keys like version, linters, settings, formatters, exclusions. You might want to copy and paste the file from the Memcached sample from the tag release v1.40.0: testdata/go/v4/memcached-operator/.golangci.yml

See #6954 for more details.

Upgrade controller-gen to v0.18.0

Update controller-gen tooling and annotations:

Makefile:

- CONTROLLER_TOOLS_VERSION ?= v0.17.2
+ CONTROLLER_TOOLS_VERSION ?= v0.18.0

Run make generate to regenerate code and manifests with the new version.

See #6954 for more details.

Upgrade controller-runtime to v0.21.0

Update the go.mod import:

- sigs.k8s.io/controller-runtime v0.20.4
+ sigs.k8s.io/controller-runtime v0.21.0

Run go mod tidy to upgrade the k8s dependencies.

See #6954 for more details.

Add cluster setup for e2e tests in Makefile and update CI workflow

Remove direct Kind commands in GitHub workflows:

Removed:

- name: Create kind cluster
  run: kind create cluster

Added to Makefile:

KIND_CLUSTER ?= <project-name>-test-e2e

.PHONY: setup-test-e2e
setup-test-e2e: ## Set up a Kind cluster for e2e tests if it does not exist
  @command -v $(KIND) >/dev/null 2>&1 || { \
    echo "Kind is not installed. Please install Kind manually."; \
    exit 1; \
  }
  @case "$$($(KIND) get clusters)" in \
    *"$(KIND_CLUSTER)"*) \
      echo "Kind cluster '$(KIND_CLUSTER)' already exists. Skipping creation." ;; \
    *) \
    echo "Creating Kind cluster '$(KIND_CLUSTER)'..."; \
    $(KIND) create cluster --name $(KIND_CLUSTER) ;; \
  esac

.PHONY: cleanup-test-e2e
cleanup-test-e2e:
	$(KIND) delete cluster --name $(KIND_CLUSTER)

Update test-e2e target to call these appropriately.

See #6954 for more details.

Last modified July 8, 2025: Release v1.41.0 (#6969) (0eefc528)