Skip to content

Commit 32858ee

Browse files
committed
chore: update talos packages
Update talos to v1.12.0-beta.0 Signed-off-by: Mateusz Urbanek <[email protected]>
1 parent cd63fd7 commit 32858ee

File tree

9 files changed

+192
-190
lines changed

9 files changed

+192
-190
lines changed

Makefile

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

12-
TOOLS ?= ghcr.io/siderolabs/tools:v1.11.0
13-
PKGS ?= v1.11.0
14-
TALOS_VERSION ?= v1.11.0
15-
K8S_VERSION ?= 1.34.0
12+
TOOLS ?= ghcr.io/siderolabs/tools:v1.12.0
13+
PKGS ?= v1.12.0
14+
TALOS_VERSION ?= v1.12.0-beta.0
15+
K8S_VERSION ?= 1.34.2
1616

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

@@ -143,20 +143,18 @@ talosctl:
143143
chmod +x ./talosctl
144144

145145
env-up: talosctl ## Start development environment.
146-
./talosctl cluster create \
147-
--talosconfig=talosconfig \
148-
--name=cabpt-env \
146+
./talosctl cluster create docker \
147+
--name=cabpt-env \
148+
--talosconfig-destination=talosconfig \
149149
--kubernetes-version=$(K8S_VERSION) \
150-
--mtu=1450 \
151-
--skip-kubeconfig
150+
--mtu=1450
152151
./talosctl kubeconfig kubeconfig \
153152
--talosconfig=talosconfig \
154153
--nodes=10.5.0.2 \
155154
--force
156155

157156
env-down: talosctl ## Stop development environment.
158157
./talosctl cluster destroy \
159-
--talosconfig=talosconfig \
160158
--name=cabpt-env
161159
rm -f talosconfig kubeconfig
162160

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ This provider's versions are able to install and manage the following versions o
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 | v1.10 | v1.11 |
65-
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
66-
| CABPT (v0.5.x) ||||| | | | | | | | |
67-
| CABPT (v0.6.x) | | |||||||||||
64+
| | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 | v1.10 | v1.11 | v1.12 |
65+
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
66+
| CABPT (v0.5.x) ||||| | | | | | | | | |
67+
| CABPT (v0.6.x) | | ||||||||||||
6868

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

@@ -151,7 +151,9 @@ There are two [patch formats](https://www.talos.dev/latest/talos-guides/configur
151151

152152
See Talos Linux documentation for more information on patching.
153153

154-
> Note: JSON patches are not compatible with multi-document Talos Linux machine configuration.
154+
> [!IMPORTANT]
155+
> JSON patches are not compatible with multi-document Talos Linux machine configuration.
156+
> JSON patches are not compatible with Talos Linux >= 1.12.
155157

156158
JSON 6902 patch:
157159

controllers/talosconfig_controller.go

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import (
1010
"errors"
1111
"fmt"
1212
"net"
13+
"slices"
1314
"strconv"
1415
"strings"
1516
"time"
1617

18+
"github.com/Masterminds/semver/v3"
1719
jsonpatch "github.com/evanphx/json-patch"
1820
"github.com/go-logr/logr"
1921
"github.com/siderolabs/talos/pkg/machinery/config"
@@ -277,6 +279,8 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
277279

278280
machineType, _ := machine.ParseType(config.Spec.GenerateType) //nolint:errcheck // handle errors later
279281

282+
multiConfigPatches := []string{}
283+
280284
switch {
281285
// Slurp and use user-supplied configs
282286
case config.Spec.GenerateType == "none":
@@ -291,7 +295,7 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
291295

292296
// Generate configs on the fly
293297
case machineType != machine.TypeUnknown:
294-
retData, err = r.genConfigs(ctx, tcScope)
298+
retData, multiConfigPatches, err = r.genConfigs(ctx, tcScope)
295299
if err != nil {
296300
return err
297301
}
@@ -322,10 +326,10 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
322326
}
323327

324328
// Handle strategic merge patches.
325-
if len(config.Spec.StrategicPatches) > 0 {
326-
patches := make([]configpatcher.Patch, 0, len(config.Spec.StrategicPatches))
329+
if strategicPatches := slices.AppendSeq(config.Spec.StrategicPatches, slices.Values(multiConfigPatches)); len(strategicPatches) > 0 {
330+
patches := make([]configpatcher.Patch, 0, len(strategicPatches))
327331

328-
for _, strategicPatch := range config.Spec.StrategicPatches {
332+
for _, strategicPatch := range strategicPatches {
329333
patch, err := configpatcher.LoadPatch([]byte(strategicPatch))
330334
if err != nil {
331335
return fmt.Errorf("failure loading StrategicPatch: %w", err)
@@ -447,7 +451,7 @@ func (r *TalosConfigReconciler) userConfigs(ctx context.Context, scope *TalosCon
447451
}
448452

449453
// genConfigs will generate a bootstrap config and a talosconfig to return
450-
func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConfigScope) (*TalosConfigBundle, error) {
454+
func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConfigScope) (*TalosConfigBundle, []string, error) {
451455
retBundle := &TalosConfigBundle{}
452456

453457
// Determine what type of node this is
@@ -456,22 +460,24 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
456460
machineType = machine.TypeWorker
457461
}
458462

463+
patches := []string{}
464+
459465
// Allow user to override default kube version.
460466
// This also handles version being formatted like "vX.Y.Z" instead of without leading 'v'
461467
// TrimPrefix returns the string unchanged if the prefix isn't present.
462468
k8sVersion := constants.DefaultKubernetesVersion
463469
if scope.ConfigOwner.IsMachinePool() {
464470
mp := &expv1.MachinePool{}
465471
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(scope.ConfigOwner.Object, mp); err != nil {
466-
return retBundle, err
472+
return retBundle, patches, err
467473
}
468474
if mp.Spec.Template.Spec.Version != nil {
469475
k8sVersion = strings.TrimPrefix(*mp.Spec.Template.Spec.Version, "v")
470476
}
471477
} else {
472478
machine := &capiv1.Machine{}
473479
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(scope.ConfigOwner.Object, machine); err != nil {
474-
return retBundle, err
480+
return retBundle, patches, err
475481
}
476482
if machine.Spec.Version != nil {
477483
k8sVersion = strings.TrimPrefix(*machine.Spec.Version, "v")
@@ -491,15 +497,15 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
491497
var err error
492498
versionContract, err = config.ParseContractFromVersion(scope.Config.Spec.TalosVersion)
493499
if err != nil {
494-
return retBundle, fmt.Errorf("invalid talos-version: %w", err)
500+
return retBundle, patches, fmt.Errorf("invalid talos-version: %w", err)
495501
}
496502
}
497503

498504
genOptions = append(genOptions, generate.WithVersionContract(versionContract))
499505

500506
secretBundle, err := r.getSecretsBundle(ctx, scope, true, versionContract)
501507
if err != nil {
502-
return retBundle, err
508+
return retBundle, patches, err
503509
}
504510

505511
genOptions = append(genOptions, generate.WithSecretsBundle(secretBundle))
@@ -518,24 +524,24 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
518524
genOptions...,
519525
)
520526
if err != nil {
521-
return retBundle, err
527+
return retBundle, patches, err
522528
}
523529

524530
// Create the secret with kubernetes certs so a kubeconfig can be generated
525531
if err = r.writeK8sCASecret(ctx, scope, secretBundle.Certs.K8s); err != nil {
526-
return retBundle, err
532+
return retBundle, patches, err
527533
}
528534

529535
tcString, err := genTalosConfigFile(input.ClusterName, secretBundle, nil)
530536
if err != nil {
531-
return retBundle, err
537+
return retBundle, patches, err
532538
}
533539

534540
retBundle.TalosConfig = tcString
535541

536542
data, err := input.Config(machineType)
537543
if err != nil {
538-
return retBundle, err
544+
return retBundle, patches, err
539545
}
540546

541547
if scope.Cluster.Spec.ClusterNetwork != nil && scope.Cluster.Spec.ClusterNetwork.Pods != nil {
@@ -550,27 +556,38 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
550556
data.RawV1Alpha1().MachineConfig.MachineNetwork = &v1alpha1.NetworkConfig{}
551557
}
552558

559+
talosVersion, parseErr := semver.NewVersion(strings.TrimLeft(scope.Config.Spec.TalosVersion, "v"))
560+
553561
if scope.Config.Spec.Hostname.Source == v1alpha3.HostnameSourceMachineName {
554-
data.RawV1Alpha1().MachineConfig.MachineNetwork.NetworkHostname = scope.ConfigOwner.GetName()
562+
if parseErr == nil && talosVersion.GreaterThanEqual(semver.MustParse("1.12.0-beta.0")) {
563+
patches = append(patches, fmt.Sprintf("apiVersion: v1alpha1\nkind: HostnameConfig\nauto: off\nhostname: %s", scope.ConfigOwner.GetName()))
564+
} else {
565+
data.RawV1Alpha1().MachineConfig.MachineNetwork.NetworkHostname = scope.ConfigOwner.GetName()
566+
}
555567
}
556568

557569
if scope.Config.Spec.Hostname.Source == v1alpha3.HostnameSourceInfrastructureName {
558570
machine := &capiv1.Machine{}
559571
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(scope.ConfigOwner.Object, machine); err != nil {
560-
return retBundle, err
572+
return retBundle, patches, err
573+
}
574+
575+
if parseErr == nil && talosVersion.GreaterThanEqual(semver.MustParse("1.12.0-beta.0")) {
576+
patches = append(patches, fmt.Sprintf("apiVersion: v1alpha1\nkind: HostnameConfig\nauto: off\nhostname: %s", machine.Spec.InfrastructureRef.Name))
577+
} else {
578+
data.RawV1Alpha1().MachineConfig.MachineNetwork.NetworkHostname = machine.Spec.InfrastructureRef.Name
561579
}
562-
data.RawV1Alpha1().MachineConfig.MachineNetwork.NetworkHostname = machine.Spec.InfrastructureRef.Name
563580
}
564581
}
565582

566583
dataOut, err := data.EncodeString(encoder.WithComments(encoder.CommentsDisabled))
567584
if err != nil {
568-
return retBundle, err
585+
return retBundle, patches, err
569586
}
570587

571588
retBundle.BootstrapData = dataOut
572589

573-
return retBundle, nil
590+
return retBundle, patches, nil
574591
}
575592

576593
// MachineToBootstrapMapFunc is a handler.ToRequestsFunc to be used to enqueue

go.mod

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/siderolabs/cluster-api-bootstrap-provider-talos
22

3-
go 1.24.0
3+
go 1.25.3
44

55
// compatibility with kube-apiserver v0.32.3, should be dropped once kube-apiserver dependency is updated
66
replace github.com/google/cel-go => github.com/google/cel-go v0.22.0
@@ -9,12 +9,12 @@ require (
99
github.com/evanphx/json-patch v5.9.11+incompatible
1010
github.com/go-logr/logr v1.4.3
1111
github.com/google/go-cmp v0.7.0
12-
github.com/siderolabs/crypto v0.6.3
12+
github.com/siderolabs/crypto v0.6.4
1313
github.com/siderolabs/go-pointer v1.0.1
14-
github.com/siderolabs/talos/pkg/machinery v1.11.0
14+
github.com/siderolabs/talos/pkg/machinery v1.12.0-beta.0
1515
github.com/spf13/pflag v1.0.7
16-
github.com/stretchr/testify v1.10.0
17-
golang.org/x/sys v0.35.0
16+
github.com/stretchr/testify v1.11.1
17+
golang.org/x/sys v0.38.0
1818
gopkg.in/yaml.v2 v2.4.0
1919
k8s.io/api v0.32.3
2020
k8s.io/apiextensions-apiserver v0.32.3
@@ -34,7 +34,7 @@ require (
3434
github.com/Masterminds/semver/v3 v3.3.0 // indirect
3535
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
3636
github.com/NYTimes/gziphandler v1.1.1 // indirect
37-
github.com/ProtonMail/go-crypto v1.2.0 // indirect
37+
github.com/ProtonMail/go-crypto v1.3.0 // indirect
3838
github.com/adrg/xdg v0.5.3 // indirect
3939
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
4040
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
@@ -43,17 +43,17 @@ require (
4343
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
4444
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4545
github.com/cloudflare/circl v1.6.1 // indirect
46-
github.com/containerd/go-cni v1.1.12 // indirect
47-
github.com/containernetworking/cni v1.2.3 // indirect
48-
github.com/cosi-project/runtime v1.10.7 // indirect
46+
github.com/containerd/go-cni v1.1.13 // indirect
47+
github.com/containernetworking/cni v1.3.0 // indirect
48+
github.com/cosi-project/runtime v1.12.0 // indirect
4949
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5050
github.com/distribution/reference v0.6.0 // indirect
5151
github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect
5252
github.com/dustin/go-humanize v1.0.1 // indirect
5353
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
5454
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
5555
github.com/felixge/httpsnoop v1.0.4 // indirect
56-
github.com/fsnotify/fsnotify v1.8.0 // indirect
56+
github.com/fsnotify/fsnotify v1.9.0 // indirect
5757
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
5858
github.com/gertd/go-pluralize v0.2.1 // indirect
5959
github.com/ghodss/yaml v1.0.0 // indirect
@@ -67,25 +67,25 @@ require (
6767
github.com/gogo/protobuf v1.3.2 // indirect
6868
github.com/golang/protobuf v1.5.4 // indirect
6969
github.com/google/btree v1.1.3 // indirect
70-
github.com/google/cel-go v0.26.0 // indirect
70+
github.com/google/cel-go v0.26.1 // indirect
7171
github.com/google/gnostic-models v0.6.8 // indirect
7272
github.com/google/go-github/v53 v53.2.0 // indirect
7373
github.com/google/go-querystring v1.1.0 // indirect
7474
github.com/google/gofuzz v1.2.0 // indirect
7575
github.com/google/uuid v1.6.0 // indirect
76-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
76+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
7777
github.com/hashicorp/errwrap v1.1.0 // indirect
7878
github.com/hashicorp/go-multierror v1.1.1 // indirect
7979
github.com/huandu/xstrings v1.5.0 // indirect
8080
github.com/inconshreveable/mousetrap v1.1.0 // indirect
8181
github.com/josharian/intern v1.0.0 // indirect
8282
github.com/josharian/native v1.1.0 // indirect
83-
github.com/jsimonetti/rtnetlink/v2 v2.0.5 // indirect
83+
github.com/jsimonetti/rtnetlink/v2 v2.1.0 // indirect
8484
github.com/json-iterator/go v1.1.12 // indirect
8585
github.com/mailru/easyjson v0.7.7 // indirect
8686
github.com/mdlayher/ethtool v0.4.0 // indirect
8787
github.com/mdlayher/genetlink v1.3.2 // indirect
88-
github.com/mdlayher/netlink v1.7.2 // indirect
88+
github.com/mdlayher/netlink v1.8.0 // indirect
8989
github.com/mdlayher/socket v0.5.1 // indirect
9090
github.com/mitchellh/copystructure v1.2.0 // indirect
9191
github.com/mitchellh/reflectwalk v1.0.2 // indirect
@@ -108,9 +108,9 @@ require (
108108
github.com/sagikazarmark/locafero v0.7.0 // indirect
109109
github.com/sasha-s/go-deadlock v0.3.5 // indirect
110110
github.com/shopspring/decimal v1.4.0 // indirect
111-
github.com/siderolabs/gen v0.8.5 // indirect
111+
github.com/siderolabs/gen v0.8.6 // indirect
112112
github.com/siderolabs/net v0.4.0 // indirect
113-
github.com/siderolabs/protoenc v0.2.2 // indirect
113+
github.com/siderolabs/protoenc v0.2.4 // indirect
114114
github.com/sourcegraph/conc v0.3.0 // indirect
115115
github.com/spf13/afero v1.12.0 // indirect
116116
github.com/spf13/cast v1.7.1 // indirect
@@ -122,28 +122,29 @@ require (
122122
github.com/x448/float16 v0.8.4 // indirect
123123
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
124124
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
125-
go.opentelemetry.io/otel v1.35.0 // indirect
125+
go.opentelemetry.io/otel v1.37.0 // indirect
126126
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
127127
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
128-
go.opentelemetry.io/otel/metric v1.35.0 // indirect
129-
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
130-
go.opentelemetry.io/otel/trace v1.35.0 // indirect
128+
go.opentelemetry.io/otel/metric v1.37.0 // indirect
129+
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
130+
go.opentelemetry.io/otel/trace v1.37.0 // indirect
131131
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
132132
go.uber.org/multierr v1.11.0 // indirect
133133
go.uber.org/zap v1.27.0 // indirect
134-
golang.org/x/crypto v0.38.0 // indirect
134+
go.yaml.in/yaml/v4 v4.0.0-rc.3 // indirect
135+
golang.org/x/crypto v0.44.0 // indirect
135136
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
136-
golang.org/x/net v0.40.0 // indirect
137-
golang.org/x/oauth2 v0.28.0 // indirect
138-
golang.org/x/sync v0.15.0 // indirect
139-
golang.org/x/term v0.32.0 // indirect
140-
golang.org/x/text v0.25.0 // indirect
141-
golang.org/x/time v0.11.0 // indirect
137+
golang.org/x/net v0.47.0 // indirect
138+
golang.org/x/oauth2 v0.30.0 // indirect
139+
golang.org/x/sync v0.18.0 // indirect
140+
golang.org/x/term v0.37.0 // indirect
141+
golang.org/x/text v0.31.0 // indirect
142+
golang.org/x/time v0.14.0 // indirect
142143
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
143-
google.golang.org/genproto/googleapis/api v0.0.0-20250715232539-7130f93afb79 // indirect
144-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250715232539-7130f93afb79 // indirect
145-
google.golang.org/grpc v1.73.0 // indirect
146-
google.golang.org/protobuf v1.36.6 // indirect
144+
google.golang.org/genproto/googleapis/api v0.0.0-20251111163417-95abcf5c77ba // indirect
145+
google.golang.org/genproto/googleapis/rpc v0.0.0-20251111163417-95abcf5c77ba // indirect
146+
google.golang.org/grpc v1.76.0 // indirect
147+
google.golang.org/protobuf v1.36.10 // indirect
147148
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
148149
gopkg.in/inf.v0 v0.9.1 // indirect
149150
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)