Skip to content

Commit 8afdbec

Browse files
committed
feat: update Talos to 1.10-beta.0, CAPI to 1.10-rc.1
Use new toolchain, fix small issues. Fixes siderolabs/talos#10690 Signed-off-by: Andrey Smirnov <[email protected]>
1 parent 7fcb5b3 commit 8afdbec

10 files changed

+311
-305
lines changed

Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax = docker/dockerfile-upstream:1.2.0-labs
1+
# syntax = docker/dockerfile-upstream:1.14.1-labs
22

33
# Meta args applied to stage base names.
44

@@ -14,21 +14,19 @@ FROM ghcr.io/siderolabs/fhs:${PKGS} AS pkg-fhs
1414
# code
1515

1616
FROM --platform=${BUILDPLATFORM} ${TOOLS} AS build
17-
SHELL ["/toolchain/bin/bash", "-c"]
18-
ENV PATH /toolchain/bin:/toolchain/go/bin:/go/bin
19-
RUN ["/toolchain/bin/mkdir", "/bin", "/tmp"]
20-
RUN ["/toolchain/bin/ln", "-svf", "/toolchain/bin/bash", "/bin/sh"]
21-
RUN ["/toolchain/bin/ln", "-svf", "/toolchain/etc/ssl", "/etc/ssl"]
22-
ENV GO111MODULE on
23-
ENV GOPROXY https://proxy.golang.org
24-
ENV CGO_ENABLED 0
25-
ENV GOCACHE /.cache/go-build
26-
ENV GOMODCACHE /.cache/mod
27-
ENV GOTOOLCHAIN local
17+
ENV GOTOOLCHAIN=local
18+
ENV CGO_ENABLED=0
19+
ENV GO111MODULE=on
20+
ENV GOPROXY=https://proxy.golang.org
21+
ENV GOCACHE=/.cache/go-build
22+
ENV GOMODCACHE=/.cache/mod
23+
SHELL ["/bin/bash", "-c"]
2824
ARG CONTROLLER_GEN_VERSION
2925
ARG CONVERSION_GEN_VERSION
30-
RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION}
31-
RUN --mount=type=cache,target=/.cache go install k8s.io/code-generator/cmd/conversion-gen@${CONVERSION_GEN_VERSION}
26+
RUN --mount=type=cache,target=/.cache go install sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_GEN_VERSION} \
27+
&& mv /root/go/bin/controller-gen /usr/bin/controller-gen
28+
RUN --mount=type=cache,target=/.cache go install k8s.io/code-generator/cmd/conversion-gen@${CONVERSION_GEN_VERSION} \
29+
&& mv /root/go/bin/conversion-gen /usr/bin/conversion-gen
3230
WORKDIR /src
3331
COPY ./go.mod ./
3432
COPY ./go.sum ./
@@ -64,7 +62,7 @@ RUN --mount=type=cache,target=/.cache go test -race -ldflags "${GO_LDFLAGS}" -co
6462
FROM scratch AS integration-test
6563
COPY --from=integration-test-build /src/integration.test /integration.test
6664

67-
FROM --platform=${BUILDPLATFORM} alpine:3.13 AS release-build
65+
FROM --platform=${BUILDPLATFORM} alpine:3.21 AS release-build
6866
ADD https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv4.1.0/kustomize_v4.1.0_linux_amd64.tar.gz .
6967
RUN tar -xf kustomize_v4.1.0_linux_amd64.tar.gz -C /usr/local/bin && rm kustomize_v4.1.0_linux_amd64.tar.gz
7068
COPY ./config ./config

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ NAME := cluster-api-talos-controller
99
ARTIFACTS := _out
1010
TEST_RUN ?= ./...
1111

12-
TOOLS ?= ghcr.io/siderolabs/tools:v1.9.0
13-
PKGS ?= v1.9.0
14-
TALOS_VERSION ?= v1.9.0
12+
TOOLS ?= ghcr.io/siderolabs/tools:v1.10.0
13+
PKGS ?= v1.10.0
14+
TALOS_VERSION ?= v1.10.0-beta.0
1515
K8S_VERSION ?= 1.31.4
1616

1717
KRES_IMAGE ?= ghcr.io/siderolabs/kres:latest
1818

19-
CONTROLLER_GEN_VERSION ?= v0.16.2
20-
CONVERSION_GEN_VERSION ?= v0.31.3
19+
CONTROLLER_GEN_VERSION ?= v0.17.0
20+
CONVERSION_GEN_VERSION ?= v0.32.3
2121

2222
BUILD := docker buildx build
2323
PLATFORM ?= linux/amd64

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,17 @@ This provider's versions are compatible with the following versions of Cluster A
5454

5555
This provider's versions are able to install and manage the following versions of Kubernetes:
5656
57-
| | v1.19 | v1.20 | v1.21 | v1.22 | v1.23 | v1.24 | v1.25 | v1.26 | v1.27 | v1.28 | v1.29 | v1.30 | v1.31 | v1.32 |
58-
| -------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
59-
| CABPT (v0.5.x) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | |
60-
| CABPT (v0.6.x) | | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
57+
| | v1.19 | v1.20 | v1.21 | v1.22 | v1.23 | v1.24 | v1.25 | v1.26 | v1.27 | v1.28 | v1.29 | v1.30 | v1.31 | v1.32 | v1.33 |
58+
| -------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
59+
| CABPT (v0.5.x) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | |
60+
| CABPT (v0.6.x) | | | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
6161
6262
This provider's versions are compatible with the following versions of Talos:
6363

64-
| | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 |
65-
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
66-
| CABPT (v0.5.x) ||||| | | | | | |
67-
| CABPT (v0.6.x) | | |||||||||
68-
69-
> Note: CABPT is not compatible with multi-document Talos Linux machine configuration, as it relies on JSON patch to apply configuration patches.
64+
| | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 | v1.10 |
65+
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
66+
| CABPT (v0.5.x) ||||| | | | | | | |
67+
| CABPT (v0.6.x) | | ||||||||||
7068

7169
CABPT generates machine configuration compatible with Talos Linux version specified in the `talosVersion:` field (see below).
7270

@@ -153,6 +151,8 @@ There are two [patch formats](https://www.talos.dev/latest/talos-guides/configur
153151

154152
See Talos Linux documentation for more information on patching.
155153

154+
> Note: JSON patches are not compatible with multi-document Talos Linux machine configuration.
155+
156156
JSON 6902 patch:
157157

158158
```yaml

api/v1alpha3/talosconfig_webhook.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package v1alpha3
66

77
import (
8+
"context"
89
"fmt"
910

1011
"github.com/google/go-cmp/cmp"
@@ -25,16 +26,19 @@ func (r *TalosConfig) SetupWebhookWithManager(mgr ctrl.Manager) error {
2526

2627
//+kubebuilder:webhook:verbs=create;update,path=/validate-bootstrap-cluster-x-k8s-io-v1alpha3-talosconfig,mutating=false,failurePolicy=fail,groups=bootstrap.cluster.x-k8s.io,resources=talosconfigs,versions=v1alpha3,name=vtalosconfig.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1
2728

28-
var _ webhook.Validator = &TalosConfig{}
29+
var _ webhook.CustomValidator = &TalosConfig{}
2930

3031
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
31-
func (r *TalosConfig) ValidateCreate() (admission.Warnings, error) {
32+
func (r *TalosConfig) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
33+
r = obj.(*TalosConfig)
34+
3235
return nil, r.validate()
3336
}
3437

3538
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
36-
func (r *TalosConfig) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
37-
old := oldRaw.(*TalosConfig)
39+
func (r *TalosConfig) ValidateUpdate(ctx context.Context, oldObj runtime.Object, newObj runtime.Object) (admission.Warnings, error) {
40+
old := oldObj.(*TalosConfig)
41+
r = newObj.(*TalosConfig)
3842

3943
if !cmp.Equal(r.Spec, old.Spec) {
4044
return nil, apierrors.NewBadRequest("TalosConfig.Spec is immutable")
@@ -44,7 +48,7 @@ func (r *TalosConfig) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings,
4448
}
4549

4650
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
47-
func (r *TalosConfig) ValidateDelete() (admission.Warnings, error) {
51+
func (r *TalosConfig) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
4852
return nil, nil
4953
}
5054

api/v1alpha3/talosconfigtemplate_webhook.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
package v1alpha3
66

77
import (
8+
"context"
9+
810
"github.com/google/go-cmp/cmp"
911
apierrors "k8s.io/apimachinery/pkg/api/errors"
1012
runtime "k8s.io/apimachinery/pkg/runtime"
@@ -21,16 +23,17 @@ func (r *TalosConfigTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error {
2123

2224
//+kubebuilder:webhook:verbs=update,path=/validate-bootstrap-cluster-x-k8s-io-v1alpha3-talosconfigtemplate,mutating=false,failurePolicy=fail,groups=bootstrap.cluster.x-k8s.io,resources=talosconfigtemplates,versions=v1alpha3,name=vtalosconfigtemplate.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1
2325

24-
var _ webhook.Validator = &TalosConfigTemplate{}
26+
var _ webhook.CustomValidator = &TalosConfigTemplate{}
2527

2628
// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
27-
func (r *TalosConfigTemplate) ValidateCreate() (admission.Warnings, error) {
29+
func (r *TalosConfigTemplate) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
2830
return nil, nil
2931
}
3032

3133
// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
32-
func (r *TalosConfigTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.Warnings, error) {
33-
old := oldRaw.(*TalosConfigTemplate)
34+
func (r *TalosConfigTemplate) ValidateUpdate(ctx context.Context, oldObj runtime.Object, newObj runtime.Object) (admission.Warnings, error) {
35+
old := oldObj.(*TalosConfigTemplate)
36+
r = newObj.(*TalosConfigTemplate)
3437

3538
if !cmp.Equal(r.Spec, old.Spec) {
3639
return nil, apierrors.NewBadRequest("TalosConfigTemplate.Spec is immutable")
@@ -40,6 +43,6 @@ func (r *TalosConfigTemplate) ValidateUpdate(oldRaw runtime.Object) (admission.W
4043
}
4144

4245
// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
43-
func (r *TalosConfigTemplate) ValidateDelete() (admission.Warnings, error) {
46+
func (r *TalosConfigTemplate) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
4447
return nil, nil
4548
}

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

Lines changed: 11 additions & 4 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.16.2
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
name: talosconfigs.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io
@@ -152,27 +152,32 @@ spec:
152152
properties:
153153
lastTransitionTime:
154154
description: |-
155-
Last time the condition transitioned from one status to another.
155+
lastTransitionTime is the last time the condition transitioned from one status to another.
156156
This should be when the underlying condition changed. If that is not known, then using the time when
157157
the API field changed is acceptable.
158158
format: date-time
159159
type: string
160160
message:
161161
description: |-
162-
A human readable message indicating details about the transition.
162+
message is a human readable message indicating details about the transition.
163163
This field may be empty.
164+
maxLength: 10240
165+
minLength: 1
164166
type: string
165167
reason:
166168
description: |-
167-
The reason for the condition's last transition in CamelCase.
169+
reason is the reason for the condition's last transition in CamelCase.
168170
The specific API may choose whether or not this field is considered a guaranteed API.
169171
This field may be empty.
172+
maxLength: 256
173+
minLength: 1
170174
type: string
171175
severity:
172176
description: |-
173177
severity provides an explicit classification of Reason code, so the users or machines can immediately
174178
understand the current situation and act accordingly.
175179
The Severity field MUST be set only when Status=False.
180+
maxLength: 32
176181
type: string
177182
status:
178183
description: status of the condition, one of True, False, Unknown.
@@ -182,6 +187,8 @@ spec:
182187
type of condition in CamelCase or in foo.example.com/CamelCase.
183188
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
184189
can be useful (see .node.status.conditions), the ability to deconflict is important.
190+
maxLength: 256
191+
minLength: 1
185192
type: string
186193
required:
187194
- lastTransitionTime

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

Lines changed: 1 addition & 1 deletion
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.16.2
6+
controller-gen.kubebuilder.io/version: v0.17.0
77
name: talosconfigtemplates.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io

0 commit comments

Comments
 (0)