Skip to content

Commit c0ac89b

Browse files
committed
Bump to controller-runtime v0.20 & controller-tools v0.17
Signed-off-by: Stefan Büringer [email protected]
1 parent 07d97c6 commit c0ac89b

File tree

88 files changed

+428
-484
lines changed

Some content is hidden

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

88 files changed

+428
-484
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
run:
22
timeout: 10m
3-
go: "1.22"
3+
go: "1.23"
44
build-tags:
55
- tools
66
- e2e

Makefile

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ SHELL:=/usr/bin/env bash
2323
#
2424
# Go.
2525
#
26-
GO_VERSION ?= 1.22.10
27-
GO_DIRECTIVE_VERSION ?= 1.22.0
26+
GO_VERSION ?= 1.23.0
27+
GO_DIRECTIVE_VERSION ?= 1.23.0
2828
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)
2929

30+
# Ensure correct toolchain is used
31+
GOTOOLCHAIN = go$(GO_VERSION)
32+
export GOTOOLCHAIN
33+
3034
# Use GOPROXY environment variable if set
3135
GOPROXY := $(shell go env GOPROXY)
3236
ifeq ($(GOPROXY),)
@@ -106,7 +110,7 @@ SETUP_ENVTEST_BIN := setup-envtest
106110
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
107111
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
108112

109-
CONTROLLER_GEN_VER := v0.16.1
113+
CONTROLLER_GEN_VER := v0.17.0
110114
CONTROLLER_GEN_BIN := controller-gen
111115
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
112116
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen
@@ -116,7 +120,7 @@ GOTESTSUM_BIN := gotestsum
116120
GOTESTSUM := $(abspath $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER))
117121
GOTESTSUM_PKG := gotest.tools/gotestsum
118122

119-
CONVERSION_GEN_VER := v0.31.0
123+
CONVERSION_GEN_VER := v0.32.0
120124
CONVERSION_GEN_BIN := conversion-gen
121125
# We are intentionally using the binary without version suffix, to avoid the version
122126
# in generated files.
@@ -182,7 +186,7 @@ TRIAGE_PARTY_VERSION ?= v1.6.0
182186
CONVERSION_VERIFIER_BIN := conversion-verifier
183187
CONVERSION_VERIFIER := $(abspath $(TOOLS_BIN_DIR)/$(CONVERSION_VERIFIER_BIN))
184188

185-
OPENAPI_GEN_VER := dc4e619 # main branch as of 22.04.2024
189+
OPENAPI_GEN_VER := 2c72e55 # main branch as of 03.01.2025
186190
OPENAPI_GEN_BIN := openapi-gen
187191
# We are intentionally using the binary without version suffix, to avoid the version
188192
# in generated files.
@@ -458,8 +462,6 @@ generate-go-conversions-core-api: $(CONVERSION_GEN) ## Generate conversions go c
458462
generate-go-conversions-core-exp: $(CONVERSION_GEN) ## Generate conversions go code for core exp
459463
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/apis/core/exp/v1alpha3,./internal/apis/core/exp/addons/v1alpha3,./internal/apis/core/exp/v1alpha4,./internal/apis/core/exp/addons/v1alpha4"
460464
$(CONVERSION_GEN) \
461-
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
462-
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
463465
--output-file=zz_generated.conversion.go \
464466
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
465467
./internal/apis/core/exp/v1alpha3 \
@@ -505,10 +507,6 @@ generate-go-conversions-kubeadm-bootstrap: $(CONVERSION_GEN) ## Generate convers
505507
generate-go-conversions-kubeadm-control-plane: $(CONVERSION_GEN) ## Generate conversions go code for kubeadm control plane
506508
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/apis/controlplane/kubeadm"
507509
$(CONVERSION_GEN) \
508-
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
509-
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
510-
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha3 \
511-
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha4 \
512510
--output-file=zz_generated.conversion.go \
513511
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
514512
./internal/apis/controlplane/kubeadm/v1alpha3 \
@@ -533,7 +531,7 @@ generate-go-conversions-test-extension: $(CONVERSION_GEN) ## Generate conversion
533531

534532
# The tmp/sigs.k8s.io/cluster-api symlink is a workaround to make this target run outside of GOPATH
535533
.PHONY: generate-go-openapi
536-
generate-go-openapi: $(OPENAPI_GEN) $(CONTROLLER_GEN) ## Generate openapi go code for runtime SDK
534+
generate-go-openapi: $(OPENAPI_GEN) ## Generate openapi go code for runtime SDK
537535
@mkdir -p ./tmp/sigs.k8s.io; ln -s $(ROOT_DIR) ./tmp/sigs.k8s.io/; cd ./tmp; \
538536
for pkg in "api/v1beta1" "$(EXP_DIR)/runtime/hooks/api/v1alpha1"; do \
539537
(cd ../ && $(MAKE) clean-generated-openapi-definitions SRC_DIRS="./$${pkg}"); \

Tiltfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ def load_provider_tiltfiles():
184184

185185
tilt_helper_dockerfile_header = """
186186
# Tilt image
187-
FROM golang:1.22.10 as tilt-helper
187+
FROM golang:1.23.0 as tilt-helper
188188
# Install delve. Note this should be kept in step with the Go release minor version.
189-
RUN go install github.com/go-delve/delve/cmd/dlv@v1.22
189+
RUN go install github.com/go-delve/delve/cmd/dlv@v1.23
190190
# Support live reloading with Tilt
191191
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/restart.sh && \
192192
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/master/start.sh && \
@@ -195,7 +195,7 @@ RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com
195195
"""
196196

197197
tilt_dockerfile_header = """
198-
FROM golang:1.22.10 as tilt
198+
FROM golang:1.23.0 as tilt
199199
WORKDIR /
200200
COPY --from=tilt-helper /process.txt .
201201
COPY --from=tilt-helper /start.sh .

bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
- "--leader-elect"
2323
- "--diagnostics-address=${CAPI_DIAGNOSTICS_ADDRESS:=:8443}"
2424
- "--insecure-diagnostics=${CAPI_INSECURE_DIAGNOSTICS:=false}"
25-
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},KubeadmBootstrapFormatIgnition=${EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION:=false}"
25+
- "--feature-gates=MachinePool=${EXP_MACHINE_POOL:=true},KubeadmBootstrapFormatIgnition=${EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION:=false},PriorityQueue=${EXP_PRIORITY_QUEUE:=false}"
2626
- "--bootstrap-token-ttl=${KUBEADM_BOOTSTRAP_TOKEN_TTL:=15m}"
2727
image: controller:latest
2828
name: manager

bootstrap/kubeadm/config/rbac/role.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ rules:
1717
- patch
1818
- update
1919
- watch
20+
- apiGroups:
21+
- ""
22+
resources:
23+
- events
24+
verbs:
25+
- create
26+
- patch
2027
- apiGroups:
2128
- authentication.k8s.io
2229
resources:
@@ -57,10 +64,3 @@ rules:
5764
- get
5865
- list
5966
- watch
60-
- apiGroups:
61-
- ""
62-
resources:
63-
- events
64-
verbs:
65-
- create
66-
- patch

bootstrap/kubeadm/internal/webhooks/kubeadmconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
func (webhook *KubeadmConfig) SetupWebhookWithManager(mgr ctrl.Manager) error {
3434
return ctrl.NewWebhookManagedBy(mgr).
3535
For(&bootstrapv1.KubeadmConfig{}).
36-
WithDefaulter(webhook).
36+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
3737
WithValidator(webhook).
3838
Complete()
3939
}

bootstrap/kubeadm/internal/webhooks/kubeadmconfigtemplate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
func (webhook *KubeadmConfigTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
3333
return ctrl.NewWebhookManagedBy(mgr).
3434
For(&bootstrapv1.KubeadmConfigTemplate{}).
35-
WithDefaulter(webhook).
35+
WithDefaulter(webhook, admission.DefaulterRemoveUnknownOrOmitableFields).
3636
WithValidator(webhook).
3737
Complete()
3838
}

bootstrap/kubeadm/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ import (
3737
logsv1 "k8s.io/component-base/logs/api/v1"
3838
_ "k8s.io/component-base/logs/json/register"
3939
"k8s.io/klog/v2"
40+
"k8s.io/utils/ptr"
4041
ctrl "sigs.k8s.io/controller-runtime"
4142
"sigs.k8s.io/controller-runtime/pkg/cache"
4243
"sigs.k8s.io/controller-runtime/pkg/client"
44+
"sigs.k8s.io/controller-runtime/pkg/config"
4345
"sigs.k8s.io/controller-runtime/pkg/controller"
4446
"sigs.k8s.io/controller-runtime/pkg/webhook"
4547

@@ -226,6 +228,9 @@ func main() {
226228
clusterSecretCacheSelector := labels.NewSelector().Add(*req)
227229

228230
ctrlOptions := ctrl.Options{
231+
Controller: config.Controller{
232+
UsePriorityQueue: ptr.To[bool](feature.Gates.Enabled(feature.PriorityQueue)),
233+
},
229234
Scheme: scheme,
230235
LeaderElection: enableLeaderElection,
231236
LeaderElectionID: "kubeadm-bootstrap-manager-leader-election-capi",

0 commit comments

Comments
 (0)