Skip to content

Commit df5c1e8

Browse files
Upgrade from Kubebuilder 4.5.2 to 4.6.0 and add support for k8s 1.33
1 parent 0da7ea3 commit df5c1e8

File tree

42 files changed

+405
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+405
-385
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export IMAGE_VERSION = v1.39.2
99
export SIMPLE_VERSION = $(shell (test "$(shell git describe --tags)" = "$(shell git describe --tags --abbrev=0)" && echo $(shell git describe --tags)) || echo $(shell git describe --tags --abbrev=0)+git)
1010
export GIT_VERSION = $(shell git describe --dirty --tags --always)
1111
export GIT_COMMIT = $(shell git rev-parse HEAD)
12-
export K8S_VERSION = 1.32.0
12+
export K8S_VERSION = 1.33.0
1313

1414
# Build settings
1515
export TOOLS_DIR = tools/bin

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/operator-framework/operator-sdk
22

3-
go 1.23.6
3+
go 1.24.3
44

55
require (
66
github.com/blang/semver/v4 v4.0.0
@@ -41,7 +41,7 @@ require (
4141
k8s.io/utils v0.0.0-20250321185631-1f6e0b77f77e
4242
sigs.k8s.io/controller-runtime v0.20.4
4343
sigs.k8s.io/controller-tools v0.17.2
44-
sigs.k8s.io/kubebuilder/v4 v4.5.2
44+
sigs.k8s.io/kubebuilder/v4 v4.6.0
4545
sigs.k8s.io/yaml v1.4.0
4646
)
4747

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,8 +874,8 @@ sigs.k8s.io/controller-tools v0.17.2 h1:jNFOKps8WnaRKZU2R+4vRCHnXyJanVmXBWqkuUPF
874874
sigs.k8s.io/controller-tools v0.17.2/go.mod h1:4q5tZG2JniS5M5bkiXY2/potOiXyhoZVw/U48vLkXk0=
875875
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
876876
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
877-
sigs.k8s.io/kubebuilder/v4 v4.5.2 h1:57lmVU1zwjOZAF28hBhZyaxE6qXreHYekI4yt/Q5rEU=
878-
sigs.k8s.io/kubebuilder/v4 v4.5.2/go.mod h1:oJrPYf8hkfLCh2vb40vD/Gm22CJsFHlGQz1mw2ZiQaY=
877+
sigs.k8s.io/kubebuilder/v4 v4.6.0 h1:SBc37jghs3L2UaEL91A1t5K5dANrEviUDuNic9hMQSw=
878+
sigs.k8s.io/kubebuilder/v4 v4.6.0/go.mod h1:zlXrnLiJPDPpK4hKCUrlgzzLOusfA8Sd8tpYGIrvD00=
879879
sigs.k8s.io/kustomize/api v0.18.0 h1:hTzp67k+3NEVInwz5BHyzc9rGxIauoXferXyjv5lWPo=
880880
sigs.k8s.io/kustomize/api v0.18.0/go.mod h1:f8isXnX+8b+SGLHQ6yO4JG1rdkZlvhaCf/uZbLVMb0U=
881881
sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E=

images/custom-scorecard-tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the custom-scorecard-tests binary
2-
FROM --platform=$BUILDPLATFORM golang:1.23 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
33
ARG TARGETARCH
44

55
WORKDIR /workspace

images/helm-operator/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-
FROM --platform=$BUILDPLATFORM golang:1.23 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
33
ARG TARGETARCH
44

55
WORKDIR /workspace

images/operator-sdk/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the operator-sdk binary
2-
FROM --platform=$BUILDPLATFORM golang:1.23 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
33
ARG TARGETARCH
44

55
WORKDIR /workspace

images/scorecard-test-kuttl/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the scorecard-test-kuttl binary
2-
FROM --platform=$BUILDPLATFORM golang:1.23 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
33
ARG TARGETARCH
44
ARG BUILDPLATFORM
55

images/scorecard-test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the scorecard-test binary
2-
FROM --platform=$BUILDPLATFORM golang:1.23 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
33
ARG TARGETARCH
44

55
WORKDIR /workspace

internal/plugins/manifests/v2/init.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import (
2121
"path/filepath"
2222
"strings"
2323

24-
"sigs.k8s.io/kubebuilder/v4/pkg/plugin/util"
25-
2624
"github.com/spf13/afero"
2725
"sigs.k8s.io/kubebuilder/v4/pkg/config"
2826
"sigs.k8s.io/kubebuilder/v4/pkg/machinery"
@@ -127,15 +125,6 @@ func (s *initSubcommand) Scaffold(fs machinery.Filesystem) error {
127125
return err
128126
}
129127

130-
// TODO: remove this when we bump kubebuilder to v5.x
131-
// Not adopt changes introduced by mistake in the default Makefile of kubebuilder v4.x.
132-
if operatorType == projutil.OperatorTypeGo {
133-
err = util.ReplaceInFile("Makefile", makefileTestE2ETarget, "")
134-
if err != nil {
135-
return fmt.Errorf("error replacing Makefile: %w", err)
136-
}
137-
}
138-
139128
return nil
140129
}
141130

@@ -322,17 +311,4 @@ catalog-build: opm ## Build a catalog image.
322311
catalog-push: ## Push a catalog image.
323312
$(MAKE) docker-push IMG=$(CATALOG_IMG)
324313
`
325-
326-
// TODO: remove it when we bump kubebuilder to v5.x
327-
// We will not adopt this change since it did not work and was a bug introduced in the
328-
// default Makefile of kubebuilder v4.x.
329-
makefileTestE2ETarget = `@command -v $(KIND) >/dev/null 2>&1 || { \
330-
echo "Kind is not installed. Please install Kind manually."; \
331-
exit 1; \
332-
}
333-
@$(KIND) get clusters | grep -q 'kind' || { \
334-
echo "No Kind cluster is running. Please start a Kind cluster before running the e2e tests."; \
335-
exit 1; \
336-
}
337-
`
338314
)

testdata/go/v4/memcached-operator/.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Kubebuilder DevContainer",
3-
"image": "docker.io/golang:1.23",
3+
"image": "golang:1.24",
44
"features": {
55
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
66
"ghcr.io/devcontainers/features/git:1": {}

0 commit comments

Comments
 (0)