Skip to content

Commit 1ae1b86

Browse files
steffen-karlssonsmira
authored andcommitted
feat: upgrade to CAPI v1.11.x
Upgrading the `cluster-api` version from `v1.10.4` to `v1.11.1` with underlying changes to Talos specific configs, same logic as before. Signed-off-by: Steffen Karlsson <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]>
1 parent 5b26ed7 commit 1ae1b86

18 files changed

+243
-270
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ K8S_VERSION ?= 1.34.0
1616

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

19-
CONTROLLER_GEN_VERSION ?= v0.17.0
20-
CONVERSION_GEN_VERSION ?= v0.32.3
19+
CONTROLLER_GEN_VERSION ?= v0.18.0
20+
CONVERSION_GEN_VERSION ?= v0.33.3
2121

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

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,27 @@ providers:
4747
4848
This provider's versions are compatible with the following versions of Cluster API:
4949

50-
| | v1alpha3 (v0.3) | v1alpha4 (v0.4) | v1beta1 (v1.x) |
51-
| -------------- | --------------- | --------------- | -------------- |
52-
| CABPT (v0.5.x) | | ||
53-
| CABPT (v0.6.x) | | ||
50+
| | v1alpha3 (v0.3) | v1alpha4 (v0.4) | v1beta1 (v1.x) | v1beta2 (v1.1.x) |
51+
| -------------- | --------------- | --------------- | -------------- | -------------- |
52+
| CABPT (v0.5.x) | | || |
53+
| CABPT (v0.6.x) | | || |
54+
| CABPT (v0.7.x) | | | ||
5455

5556
This provider's versions are able to install and manage the following versions of Kubernetes:
5657
5758
| | 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 | v1.34 |
5859
| -------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
5960
| CABPT (v0.5.x) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | |
6061
| CABPT (v0.6.x) | | | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
62+
| CABPT (v0.7.x) | | | | | | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
6163
6264
This provider's versions are compatible with the following versions of Talos:
6365

6466
| | v1.0 | v1.1 | v1.2 | v1.3 | v1.4 | v1.5 | v1.6 | v1.7 | v1.8 | v1.9 | v1.10 | v1.11 |
6567
| ---------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- |
6668
| CABPT (v0.5.x) ||||| | | | | | | | |
6769
| CABPT (v0.6.x) | | |||||||||||
70+
| CABPT (v0.7.x) | | | | | | | | | ||||
6871

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

api/v1alpha3/conditions.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
package v1alpha3
66

7-
import (
8-
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
9-
)
10-
117
// Conditions and condition Reasons for the TalosConfig object
128

139
const (
@@ -16,7 +12,7 @@ const (
1612
// NOTE: When the DataSecret generation starts the process completes immediately and within the
1713
// same reconciliation, so the user will always see a transition from Wait to Generated without having
1814
// evidence that BootstrapSecret generation is started/in progress.
19-
DataSecretAvailableCondition capiv1.ConditionType = "DataSecretAvailable"
15+
DataSecretAvailableCondition string = "DataSecretAvailable"
2016

2117
// WaitingForClusterInfrastructureReason (Severity=Info) document a bootstrap secret generation process
2218
// waiting for the cluster infrastructure to be ready.
@@ -33,7 +29,7 @@ const (
3329

3430
const (
3531
// ClientConfigAvailableCondition documents the status of the client config generation process.
36-
ClientConfigAvailableCondition capiv1.ConditionType = "ClientConfigAvailable"
32+
ClientConfigAvailableCondition string = "ClientConfigAvailable"
3733

3834
// ClientConfigGenerationFailedReason (Severity=Warning) documents a TalosConfig controller detecting
3935
// an error while generating a client config; those kind of errors are usually due to misconfigurations

api/v1alpha3/talosconfig_types.go

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

77
import (
88
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9-
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
109
)
1110

1211
const (
@@ -76,7 +75,7 @@ type TalosConfigStatus struct {
7675

7776
// Conditions defines current service state of the TalosConfig.
7877
// +optional
79-
Conditions capiv1.Conditions `json:"conditions,omitempty"`
78+
Conditions []metav1.Condition `json:"conditions,omitempty"`
8079
}
8180

8281
// +kubebuilder:object:root=true
@@ -94,12 +93,12 @@ type TalosConfig struct {
9493
}
9594

9695
// GetConditions returns the set of conditions for this object.
97-
func (c *TalosConfig) GetConditions() capiv1.Conditions {
96+
func (c *TalosConfig) GetConditions() []metav1.Condition {
9897
return c.Status.Conditions
9998
}
10099

101100
// SetConditions sets the conditions on this object.
102-
func (c *TalosConfig) SetConditions(conditions capiv1.Conditions) {
101+
func (c *TalosConfig) SetConditions(conditions []metav1.Condition) {
103102
c.Status.Conditions = conditions
104103
}
105104

api/v1alpha3/zz_generated.deepcopy.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 30 additions & 25 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.17.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: talosconfigs.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io
@@ -147,51 +147,56 @@ spec:
147147
conditions:
148148
description: Conditions defines current service state of the TalosConfig.
149149
items:
150-
description: Condition defines an observation of a Cluster API resource
151-
operational state.
150+
description: Condition contains details for one aspect of the current
151+
state of this API Resource.
152152
properties:
153153
lastTransitionTime:
154154
description: |-
155155
lastTransitionTime is the last time the condition transitioned from one status to another.
156-
This should be when the underlying condition changed. If that is not known, then using the time when
157-
the API field changed is acceptable.
156+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
158157
format: date-time
159158
type: string
160159
message:
161160
description: |-
162161
message is a human readable message indicating details about the transition.
163-
This field may be empty.
164-
maxLength: 10240
165-
minLength: 1
162+
This may be an empty string.
163+
maxLength: 32768
166164
type: string
165+
observedGeneration:
166+
description: |-
167+
observedGeneration represents the .metadata.generation that the condition was set based upon.
168+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
169+
with respect to the current state of the instance.
170+
format: int64
171+
minimum: 0
172+
type: integer
167173
reason:
168174
description: |-
169-
reason is the reason for the condition's last transition in CamelCase.
170-
The specific API may choose whether or not this field is considered a guaranteed API.
171-
This field may be empty.
172-
maxLength: 256
175+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
176+
Producers of specific condition types may define expected values and meanings for this field,
177+
and whether the values are considered a guaranteed API.
178+
The value should be a CamelCase string.
179+
This field may not be empty.
180+
maxLength: 1024
173181
minLength: 1
174-
type: string
175-
severity:
176-
description: |-
177-
severity provides an explicit classification of Reason code, so the users or machines can immediately
178-
understand the current situation and act accordingly.
179-
The Severity field MUST be set only when Status=False.
180-
maxLength: 32
182+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
181183
type: string
182184
status:
183185
description: status of the condition, one of True, False, Unknown.
186+
enum:
187+
- "True"
188+
- "False"
189+
- Unknown
184190
type: string
185191
type:
186-
description: |-
187-
type of condition in CamelCase or in foo.example.com/CamelCase.
188-
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
189-
can be useful (see .node.status.conditions), the ability to deconflict is important.
190-
maxLength: 256
191-
minLength: 1
192+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
193+
maxLength: 316
194+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
192195
type: string
193196
required:
194197
- lastTransitionTime
198+
- message
199+
- reason
195200
- status
196201
- type
197202
type: object

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.17.0
6+
controller-gen.kubebuilder.io/version: v0.18.0
77
name: talosconfigtemplates.bootstrap.cluster.x-k8s.io
88
spec:
99
group: bootstrap.cluster.x-k8s.io

controllers/scheme.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ package controllers
77
import (
88
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
99
"k8s.io/client-go/kubernetes/scheme"
10-
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
11-
expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1"
10+
capiv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
1211

1312
bootstrapv1alpha2 "github.com/siderolabs/cluster-api-bootstrap-provider-talos/api/v1alpha2"
1413
bootstrapv1alpha3 "github.com/siderolabs/cluster-api-bootstrap-provider-talos/api/v1alpha3"
@@ -18,7 +17,6 @@ import (
1817
// Use shared scheme for all calls.
1918
func init() {
2019
utilruntime.Must(capiv1.AddToScheme(scheme.Scheme))
21-
utilruntime.Must(expv1.AddToScheme(scheme.Scheme))
2220
utilruntime.Must(bootstrapv1alpha2.AddToScheme(scheme.Scheme))
2321
utilruntime.Must(bootstrapv1alpha3.AddToScheme(scheme.Scheme))
2422

controllers/secrets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
corev1 "k8s.io/api/core/v1"
2020
k8serrors "k8s.io/apimachinery/pkg/api/errors"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22-
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
capiv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
"sigs.k8s.io/cluster-api/util/collections"
2424
"sigs.k8s.io/controller-runtime/pkg/client"
2525

0 commit comments

Comments
 (0)