Skip to content

Commit 001f85d

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 001f85d

File tree

8 files changed

+180
-185
lines changed

8 files changed

+180
-185
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: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"strings"
1515
"time"
1616

17+
"github.com/Masterminds/semver/v3"
1718
jsonpatch "github.com/evanphx/json-patch"
1819
"github.com/go-logr/logr"
1920
"github.com/siderolabs/talos/pkg/machinery/config"
@@ -277,6 +278,8 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
277278

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

281+
multiConfigPatches := []string{}
282+
280283
switch {
281284
// Slurp and use user-supplied configs
282285
case config.Spec.GenerateType == "none":
@@ -291,7 +294,7 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
291294

292295
// Generate configs on the fly
293296
case machineType != machine.TypeUnknown:
294-
retData, err = r.genConfigs(ctx, tcScope)
297+
retData, multiConfigPatches, err = r.genConfigs(ctx, tcScope)
295298
if err != nil {
296299
return err
297300
}
@@ -321,6 +324,8 @@ func (r *TalosConfigReconciler) reconcileGenerate(ctx context.Context, tcScope *
321324
retData.BootstrapData = string(patchedBytes)
322325
}
323326

327+
config.Spec.StrategicPatches = append(config.Spec.StrategicPatches, multiConfigPatches...)
328+
324329
// Handle strategic merge patches.
325330
if len(config.Spec.StrategicPatches) > 0 {
326331
patches := make([]configpatcher.Patch, 0, len(config.Spec.StrategicPatches))
@@ -447,7 +452,7 @@ func (r *TalosConfigReconciler) userConfigs(ctx context.Context, scope *TalosCon
447452
}
448453

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

453458
// Determine what type of node this is
@@ -456,22 +461,24 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
456461
machineType = machine.TypeWorker
457462
}
458463

464+
patches := []string{}
465+
459466
// Allow user to override default kube version.
460467
// This also handles version being formatted like "vX.Y.Z" instead of without leading 'v'
461468
// TrimPrefix returns the string unchanged if the prefix isn't present.
462469
k8sVersion := constants.DefaultKubernetesVersion
463470
if scope.ConfigOwner.IsMachinePool() {
464471
mp := &expv1.MachinePool{}
465472
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(scope.ConfigOwner.Object, mp); err != nil {
466-
return retBundle, err
473+
return retBundle, patches, err
467474
}
468475
if mp.Spec.Template.Spec.Version != nil {
469476
k8sVersion = strings.TrimPrefix(*mp.Spec.Template.Spec.Version, "v")
470477
}
471478
} else {
472479
machine := &capiv1.Machine{}
473480
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(scope.ConfigOwner.Object, machine); err != nil {
474-
return retBundle, err
481+
return retBundle, patches, err
475482
}
476483
if machine.Spec.Version != nil {
477484
k8sVersion = strings.TrimPrefix(*machine.Spec.Version, "v")
@@ -491,15 +498,15 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
491498
var err error
492499
versionContract, err = config.ParseContractFromVersion(scope.Config.Spec.TalosVersion)
493500
if err != nil {
494-
return retBundle, fmt.Errorf("invalid talos-version: %w", err)
501+
return retBundle, patches, fmt.Errorf("invalid talos-version: %w", err)
495502
}
496503
}
497504

498505
genOptions = append(genOptions, generate.WithVersionContract(versionContract))
499506

500507
secretBundle, err := r.getSecretsBundle(ctx, scope, true, versionContract)
501508
if err != nil {
502-
return retBundle, err
509+
return retBundle, patches, err
503510
}
504511

505512
genOptions = append(genOptions, generate.WithSecretsBundle(secretBundle))
@@ -518,24 +525,24 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
518525
genOptions...,
519526
)
520527
if err != nil {
521-
return retBundle, err
528+
return retBundle, patches, err
522529
}
523530

524531
// Create the secret with kubernetes certs so a kubeconfig can be generated
525532
if err = r.writeK8sCASecret(ctx, scope, secretBundle.Certs.K8s); err != nil {
526-
return retBundle, err
533+
return retBundle, patches, err
527534
}
528535

529536
tcString, err := genTalosConfigFile(input.ClusterName, secretBundle, nil)
530537
if err != nil {
531-
return retBundle, err
538+
return retBundle, patches, err
532539
}
533540

534541
retBundle.TalosConfig = tcString
535542

536543
data, err := input.Config(machineType)
537544
if err != nil {
538-
return retBundle, err
545+
return retBundle, patches, err
539546
}
540547

541548
if scope.Cluster.Spec.ClusterNetwork != nil && scope.Cluster.Spec.ClusterNetwork.Pods != nil {
@@ -550,27 +557,38 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
550557
data.RawV1Alpha1().MachineConfig.MachineNetwork = &v1alpha1.NetworkConfig{}
551558
}
552559

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

557570
if scope.Config.Spec.Hostname.Source == v1alpha3.HostnameSourceInfrastructureName {
558571
machine := &capiv1.Machine{}
559572
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(scope.ConfigOwner.Object, machine); err != nil {
560-
return retBundle, err
573+
return retBundle, patches, err
574+
}
575+
576+
if parseErr == nil && talosVersion.LessThan(semver.MustParse("1.12.0-beta.0")) {
577+
patches = append(patches, fmt.Sprintf("apiVersion: v1alpha1\nkind: HostnameConfig\nauto: off\nhostname: %s", machine.Spec.InfrastructureRef.Name))
578+
} else {
579+
data.RawV1Alpha1().MachineConfig.MachineNetwork.NetworkHostname = machine.Spec.InfrastructureRef.Name
561580
}
562-
data.RawV1Alpha1().MachineConfig.MachineNetwork.NetworkHostname = machine.Spec.InfrastructureRef.Name
563581
}
564582
}
565583

566584
dataOut, err := data.EncodeString(encoder.WithComments(encoder.CommentsDisabled))
567585
if err != nil {
568-
return retBundle, err
586+
return retBundle, patches, err
569587
}
570588

571589
retBundle.BootstrapData = dataOut
572590

573-
return retBundle, nil
591+
return retBundle, patches, nil
574592
}
575593

576594
// 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)