Skip to content

Commit 6ebed45

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 6ebed45

File tree

8 files changed

+295
-299
lines changed

8 files changed

+295
-299
lines changed

Dockerfile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)