Skip to content

Commit 5ede328

Browse files
authored
Merge pull request #160 from richardcase/capi_bump
feat: capi bump to v1.10.x
2 parents 4e645e2 + 50daf0a commit 5ede328

34 files changed

+596
-590
lines changed

.golangci.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
run:
2-
skip-files:
3-
- ".*zz_generated.*\\.go"
4-
- "contrib/.*"
5-
timeout: 5m
2+
go: "1.23"
3+
timeout: 10m
4+
65
issue:
76
max-same-issues: 0
87
max-per-linter: 0
9-
issues:
10-
exclude-rules:
11-
- path: "test/e2e/*"
12-
linters:
13-
- gosec
14-
text: "G106:"
15-
- linters:
16-
- revive
17-
text: "dot-imports"
18-
path: ".*test.*"
19-
- linters:
20-
- stylecheck
21-
text: "ST1001"
22-
path: ".*test.*"
23-
8+
exclude-files:
9+
- ".*zz_generated.*\\.go"
10+
- "contrib/.*"
11+
2412
linters:
2513
fast: true
2614
disable-all: true
2715
enable:
2816
- asciicheck
2917
- bodyclose
18+
- copyloopvar
3019
- depguard
3120
- dogsled
3221
- errcheck
33-
- exportloopref
3422
- gci
3523
- goconst
3624
- gocritic
@@ -117,6 +105,7 @@ linters-settings:
117105
excludes:
118106
- G307 # Deferring unsafe method "Close" on type "\*os.File"
119107
- G108 # Profiling endpoint is automatically exposed on /debug/pprof
108+
- G115 # integer overflow conversion int -> int32
120109
importas:
121110
# Do not allow unaliased imports of aliased packages.
122111
# Default: false
@@ -147,15 +136,29 @@ linters-settings:
147136
- disableStutteringCheck
148137
- name: unused-parameter
149138
disabled: true
150-
staticcheck:
151-
go: "1.22"
152-
stylecheck:
153-
go: "1.22"
154139
tagliatelle:
155140
case:
156141
rules:
157142
# Any struct tag type can be used.
158143
# Support string case: `camel`, `pascal`, `kebab`, `snake`, `goCamel`, `goPascal`, `goKebab`, `goSnake`, `upper`, `lower`, `header`
159144
json: goCamel
160145
unused:
161-
go: "1.22"
146+
go: "1.23"
147+
148+
issues:
149+
exclude-rules:
150+
- path: "test/e2e/*"
151+
linters:
152+
- gosec
153+
text: "G106:"
154+
- linters:
155+
- revive
156+
text: "dot-imports"
157+
path: ".*test.*"
158+
- linters:
159+
- stylecheck
160+
text: "ST1001"
161+
path: ".*test.*"
162+
- linters:
163+
- govet
164+
text: "non-constant format string in call to sigs\\.k8s\\.io\\/cluster-api\\/util\\/conditions\\."

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"makefile.configureOnOpen": false
3+
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Build the manager binary
16-
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.22.5 as build
16+
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.23.8 as build
1717
ARG TARGETOS TARGETARCH
1818
ARG package
1919

Makefile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SHELL:=/usr/bin/env bash
2020

2121
.DEFAULT_GOAL:=help
2222

23-
GO_VERSION ?= 1.22.5
23+
GO_VERSION ?= 1.23.8
2424
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)
2525

2626
ARCH ?= $(shell go env GOARCH)
@@ -54,12 +54,12 @@ GOBIN=$(shell go env GOBIN)
5454
endif
5555

5656
# Sync to controller-tools version in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/hack/tools/go.mod
57-
CONTROLLER_GEN_VER := v0.14.0
57+
CONTROLLER_GEN_VER := v0.17.2
5858
CONTROLLER_GEN_BIN := controller-gen
5959
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER)
6060

6161
# Sync
62-
CONVERSION_GEN_VER := v0.29.0
62+
CONVERSION_GEN_VER := v0.32.2
6363
CONVERSION_GEN_BIN := conversion-gen
6464
CONVERSION_GEN := $(TOOLS_BIN_DIR)/$(CONVERSION_GEN_BIN)-$(CONVERSION_GEN_VER)
6565

@@ -68,24 +68,24 @@ ENVSUBST_VER := v2.0.0-20210730161058-179042472c46
6868
ENVSUBST_BIN := envsubst
6969
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)
7070

71-
ENVTEST_VER := v0.0.0-20231012212722-e25aeebc7846
71+
ENVTEST_VER := release-0.20
7272
ENVTEST_BIN := setup-envtest
7373
ENVTEST := $(TOOLS_BIN_DIR)/$(ENVTEST_BIN)
74-
ENVTEST_K8S_VERSION = "1.28.0"
74+
ENVTEST_K8S_VERSION = "1.32.0"
7575

7676
# Sync to github.com/drone/envsubst/v2 in https://github.com/kubernetes-sigs/cluster-api/blob/v{VERSION}/go.mod
7777
ENVSUBST_VER := v2.0.0-20210730161058-179042472c46
7878
ENVSUBST_BIN := envsubst
7979
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)
8080

8181
# Bump as necessary/desired to latest that supports our version of go at https://github.com/golangci/golangci-lint/releases
82-
GOLANGCI_LINT_VER := v1.57.2
82+
GOLANGCI_LINT_VER := v1.63.4
8383
GOLANGCI_LINT_BIN := golangci-lint
8484
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
8585

8686
# Keep at 4.0.4 until we figure out how to get later verisons to not mangle the calico yamls
8787
# HACK bump latest version once https://github.com/kubernetes-sigs/kustomize/issues/947 is fixed
88-
KUSTOMIZE_VER := v4.5.2
88+
KUSTOMIZE_VER := v5.6.0
8989
KUSTOMIZE_BIN := kustomize
9090
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER)
9191

@@ -197,12 +197,11 @@ generate-bootstrap: $(CONTROLLER_GEN)
197197

198198
generate-bootstrap-conversions: $(CONVERSION_GEN)
199199
$(CONVERSION_GEN) \
200-
--input-dirs=./bootstrap/api/v1beta1 \
201200
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
202201
--build-tag=ignore_autogenerated_conversions \
203-
--output-file-base=zz_generated.conversion \
204-
--output-base=./ \
205-
--go-header-file=./hack/boilerplate.go.txt
202+
--output-file=zz_generated.conversion.go \
203+
--go-header-file=./hack/boilerplate.go.txt \
204+
./bootstrap/api/v1beta1
206205

207206
# Build the docker image
208207
docker-build-bootstrap: manager-bootstrap ## Build bootstrap
@@ -279,13 +278,12 @@ generate-controlplane: $(CONTROLLER_GEN)
279278

280279
generate-controlplane-conversions: $(CONVERSION_GEN)
281280
$(CONVERSION_GEN) \
282-
--input-dirs=./controlplane/api/v1beta1 \
283281
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \
284282
--extra-peer-dirs=github.com/k3s-io/cluster-api-k3s/bootstrap/api/v1beta1 \
285283
--build-tag=ignore_autogenerated_conversions \
286-
--output-file-base=zz_generated.conversion \
287-
--output-base=./ \
288-
--go-header-file=./hack/boilerplate.go.txt
284+
--output-file=zz_generated.conversion.go \
285+
--go-header-file=./hack/boilerplate.go.txt \
286+
./controlplane/api/v1beta1
289287

290288
docker-build-controlplane: manager-controlplane ## Build control-plane
291289
DOCKER_BUILDKIT=1 docker build --build-arg builder_image=$(GO_CONTAINER_IMAGE) --build-arg goproxy=$(GOPROXY) --build-arg TARGETARCH=$(ARCH) --build-arg package=./controlplane/main.go --build-arg ldflags="$(LDFLAGS)" . -t ${CONTROLPLANE_IMG}:$(CONTROLPLANE_IMG_TAG)

bootstrap/api/v1beta1/zz_generated.conversion.go

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/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigs.yaml

Lines changed: 33 additions & 21 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.17.2
77
name: kthreesconfigs.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io
@@ -74,9 +74,8 @@ spec:
7474
type: string
7575
type: array
7676
privateRegistry:
77-
description: |-
78-
TODO: take in a object or secret and write to file. this is not useful
79-
PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
77+
description: 'PrivateRegistry registry configuration file (default:
78+
"/etc/rancher/k3s/registries.yaml")'
8079
type: string
8180
type: object
8281
files:
@@ -232,36 +231,43 @@ spec:
232231
properties:
233232
lastTransitionTime:
234233
description: |-
235-
Last time the condition transitioned from one status to another.
234+
lastTransitionTime is the last time the condition transitioned from one status to another.
236235
This should be when the underlying condition changed. If that is not known, then using the time when
237236
the API field changed is acceptable.
238237
format: date-time
239238
type: string
240239
message:
241240
description: |-
242-
A human readable message indicating details about the transition.
241+
message is a human readable message indicating details about the transition.
243242
This field may be empty.
243+
maxLength: 10240
244+
minLength: 1
244245
type: string
245246
reason:
246247
description: |-
247-
The reason for the condition's last transition in CamelCase.
248+
reason is the reason for the condition's last transition in CamelCase.
248249
The specific API may choose whether or not this field is considered a guaranteed API.
249-
This field may not be empty.
250+
This field may be empty.
251+
maxLength: 256
252+
minLength: 1
250253
type: string
251254
severity:
252255
description: |-
253-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
256+
severity provides an explicit classification of Reason code, so the users or machines can immediately
254257
understand the current situation and act accordingly.
255258
The Severity field MUST be set only when Status=False.
259+
maxLength: 32
256260
type: string
257261
status:
258-
description: Status of the condition, one of True, False, Unknown.
262+
description: status of the condition, one of True, False, Unknown.
259263
type: string
260264
type:
261265
description: |-
262-
Type of condition in CamelCase or in foo.example.com/CamelCase.
266+
type of condition in CamelCase or in foo.example.com/CamelCase.
263267
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
264268
can be useful (see .node.status.conditions), the ability to deconflict is important.
269+
maxLength: 256
270+
minLength: 1
265271
type: string
266272
required:
267273
- lastTransitionTime
@@ -360,9 +366,8 @@ spec:
360366
type: string
361367
type: array
362368
privateRegistry:
363-
description: |-
364-
TODO: take in a object or secret and write to file. this is not useful
365-
PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
369+
description: 'PrivateRegistry registry configuration file (default:
370+
"/etc/rancher/k3s/registries.yaml")'
366371
type: string
367372
type: object
368373
files:
@@ -535,36 +540,43 @@ spec:
535540
properties:
536541
lastTransitionTime:
537542
description: |-
538-
Last time the condition transitioned from one status to another.
543+
lastTransitionTime is the last time the condition transitioned from one status to another.
539544
This should be when the underlying condition changed. If that is not known, then using the time when
540545
the API field changed is acceptable.
541546
format: date-time
542547
type: string
543548
message:
544549
description: |-
545-
A human readable message indicating details about the transition.
550+
message is a human readable message indicating details about the transition.
546551
This field may be empty.
552+
maxLength: 10240
553+
minLength: 1
547554
type: string
548555
reason:
549556
description: |-
550-
The reason for the condition's last transition in CamelCase.
557+
reason is the reason for the condition's last transition in CamelCase.
551558
The specific API may choose whether or not this field is considered a guaranteed API.
552-
This field may not be empty.
559+
This field may be empty.
560+
maxLength: 256
561+
minLength: 1
553562
type: string
554563
severity:
555564
description: |-
556-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
565+
severity provides an explicit classification of Reason code, so the users or machines can immediately
557566
understand the current situation and act accordingly.
558567
The Severity field MUST be set only when Status=False.
568+
maxLength: 32
559569
type: string
560570
status:
561-
description: Status of the condition, one of True, False, Unknown.
571+
description: status of the condition, one of True, False, Unknown.
562572
type: string
563573
type:
564574
description: |-
565-
Type of condition in CamelCase or in foo.example.com/CamelCase.
575+
type of condition in CamelCase or in foo.example.com/CamelCase.
566576
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
567577
can be useful (see .node.status.conditions), the ability to deconflict is important.
578+
maxLength: 256
579+
minLength: 1
568580
type: string
569581
required:
570582
- lastTransitionTime

bootstrap/config/crd/bases/bootstrap.cluster.x-k8s.io_kthreesconfigtemplates.yaml

Lines changed: 5 additions & 7 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.17.2
77
name: kthreesconfigtemplates.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io
@@ -84,9 +84,8 @@ spec:
8484
type: string
8585
type: array
8686
privateRegistry:
87-
description: |-
88-
TODO: take in a object or secret and write to file. this is not useful
89-
PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
87+
description: 'PrivateRegistry registry configuration
88+
file (default: "/etc/rancher/k3s/registries.yaml")'
9089
type: string
9190
type: object
9291
files:
@@ -317,9 +316,8 @@ spec:
317316
type: string
318317
type: array
319318
privateRegistry:
320-
description: |-
321-
TODO: take in a object or secret and write to file. this is not useful
322-
PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
319+
description: 'PrivateRegistry registry configuration
320+
file (default: "/etc/rancher/k3s/registries.yaml")'
323321
type: string
324322
type: object
325323
files:

bootstrap/config/rbac/role.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ rules:
2222
- bootstrap.cluster.x-k8s.io
2323
resources:
2424
- kthreesconfigs
25-
verbs:
26-
- create
27-
- delete
28-
- get
29-
- list
30-
- patch
31-
- update
32-
- watch
33-
- apiGroups:
34-
- bootstrap.cluster.x-k8s.io
35-
resources:
3625
- kthreesconfigs/status
3726
verbs:
3827
- create

bootstrap/controllers/kthreesconfig_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ func (r *KThreesConfigReconciler) SetupWithManager(mgr ctrl.Manager, concurrency
546546
WithOptions(controller.Options{
547547
MaxConcurrentReconciles: concurrency,
548548
}).
549-
WithEventFilter(predicates.ResourceNotPaused(r.Log)).
549+
WithEventFilter(predicates.ResourceNotPaused(mgr.GetScheme(), r.Log)).
550550
Complete(r)
551551
}
552552

0 commit comments

Comments
 (0)