Skip to content

Commit 24b0b35

Browse files
authored
Merge pull request #3564 from sbueringer/pr-bump-capi-rc.0
✨ Bump to CAPI v1.11.0-rc.0
2 parents c5fec1d + 7ded0ab commit 24b0b35

29 files changed

+86
-84
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ IMPORT_BOSS_VER := v0.28.1
194194
IMPORT_BOSS := $(abspath $(TOOLS_BIN_DIR)/$(IMPORT_BOSS_BIN))
195195
IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss
196196

197-
CAPI_HACK_TOOLS_VER := ead3737e81eff878355a31e8aea6416ecdc0598c # Note: this the commit ID of CAPI v1.11.0-beta.2.
197+
CAPI_HACK_TOOLS_VER := 1aab5f5381716d5453f06247aaddff05e5ae8c5f # Note: this the commit ID of CAPI v1.11.0-rc.0.
198198

199199
BOSKOSCTL_BIN := boskosctl
200200
BOSKOSCTL := $(abspath $(TOOLS_BIN_DIR)/$(BOSKOSCTL_BIN))

controllers/clustermodule_reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func toAffinityInput[T client.Object](c client.Client) handler.TypedMapFunc[T, c
214214
log = log.WithValues("Cluster", klog.KObj(cluster))
215215
ctx = ctrl.LoggerInto(ctx, log)
216216

217-
if cluster.Spec.InfrastructureRef == nil {
217+
if !cluster.Spec.InfrastructureRef.IsDefined() {
218218
log.V(4).Error(err, "Failed to get VSphereCluster: Cluster.spec.infrastructureRef not set")
219219
return nil
220220
}

controllers/vmware/test/controllers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func deployInfraMachine(namespace string, machine *clusterv1.Machine, finalizers
225225
// Updates the InfrastructureRef of a CAPI Cluster to a VSphereCluster. Function
226226
// does not block on update success.
227227
func updateClusterInfraRef(cluster *clusterv1.Cluster, infraCluster client.Object, k8sClient client.Client) {
228-
cluster.Spec.InfrastructureRef = &clusterv1.ContractVersionedObjectReference{
228+
cluster.Spec.InfrastructureRef = clusterv1.ContractVersionedObjectReference{
229229
APIGroup: vmwarev1.GroupVersion.Group,
230230
Kind: "VSphereCluster",
231231
Name: infraCluster.GetName(),

controllers/vspherecluster_reconciler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ func (r *clusterReconciler) controlPlaneMachineToCluster(ctx context.Context, o
532532
return nil
533533
}
534534
log = log.WithValues("Cluster", klog.KObj(cluster))
535-
if cluster.Spec.InfrastructureRef != nil {
535+
if cluster.Spec.InfrastructureRef.IsDefined() {
536536
log = log.WithValues("VSphereCluster", klog.KRef(cluster.Namespace, cluster.Spec.InfrastructureRef.Name))
537537
}
538538
ctx = ctrl.LoggerInto(ctx, log)
@@ -547,7 +547,7 @@ func (r *clusterReconciler) controlPlaneMachineToCluster(ctx context.Context, o
547547
return nil
548548
}
549549

550-
if cluster.Spec.InfrastructureRef == nil {
550+
if !cluster.Spec.InfrastructureRef.IsDefined() {
551551
log.Error(nil, "Failed to get VSphereCluster: Cluster.spec.infrastructureRef is not yet set")
552552
return nil
553553
}

controllers/vspherecluster_reconciler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
104104
Namespace: "default",
105105
},
106106
Spec: clusterv1.ClusterSpec{
107-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
107+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
108108
APIGroup: infrav1.GroupVersion.Group,
109109
Kind: "VsphereCluster",
110110
Name: instance.Name,
@@ -173,7 +173,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
173173
Namespace: "default",
174174
},
175175
Spec: clusterv1.ClusterSpec{
176-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
176+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
177177
APIGroup: infrav1.GroupVersion.Group,
178178
Kind: "VsphereCluster",
179179
Name: "vsphere-test1",
@@ -257,7 +257,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
257257
Namespace: "default",
258258
},
259259
Spec: clusterv1.ClusterSpec{
260-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
260+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
261261
APIGroup: infrav1.GroupVersion.Group,
262262
Kind: "VsphereCluster",
263263
Name: "vsphere-test1",
@@ -365,7 +365,7 @@ var _ = Describe("VIM based VSphere ClusterReconciler", func() {
365365
Namespace: namespace.Name,
366366
},
367367
Spec: clusterv1.ClusterSpec{
368-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
368+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
369369
APIGroup: infrav1.GroupVersion.Group,
370370
Kind: "VSphereCluster",
371371
Name: "vsphere-test2",

controllers/vspheredeploymentzone_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ func createMachine(machineName, clusterName, namespace string, isControlPlane bo
547547
Spec: clusterv1.MachineSpec{
548548
Version: "v1.22.0",
549549
Bootstrap: clusterv1.Bootstrap{
550-
ConfigRef: &clusterv1.ContractVersionedObjectReference{
550+
ConfigRef: clusterv1.ContractVersionedObjectReference{
551551
APIGroup: bootstrapv1.GroupVersion.Group,
552552
Kind: "KubeadmConfig",
553553
Name: machineName,

controllers/vspheremachine_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (r *machineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
230230

231231
if cluster != nil {
232232
log = log.WithValues("Cluster", klog.KObj(cluster))
233-
if cluster.Spec.InfrastructureRef != nil {
233+
if cluster.Spec.InfrastructureRef.IsDefined() {
234234
log = log.WithValues("VSphereCluster", klog.KRef(cluster.Namespace, cluster.Spec.InfrastructureRef.Name))
235235
}
236236
ctx = ctrl.LoggerInto(ctx, log)
@@ -315,7 +315,7 @@ func (r *machineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_
315315
return reconcile.Result{}, nil
316316
}
317317

318-
if cluster.Spec.InfrastructureRef == nil {
318+
if !cluster.Spec.InfrastructureRef.IsDefined() {
319319
log.Info("Cluster.spec.infrastructureRef is not yet set")
320320
return reconcile.Result{}, nil
321321
}

controllers/vspheremachine_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var _ = Describe("VsphereMachineReconciler", func() {
6868
Namespace: testNs.Name,
6969
},
7070
Spec: clusterv1.ClusterSpec{
71-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
71+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
7272
APIGroup: "infrastructure.cluster.x-k8s.io",
7373
Kind: "VSphereCluster",
7474
Name: "vsphere-test1",
@@ -106,7 +106,7 @@ var _ = Describe("VsphereMachineReconciler", func() {
106106
Spec: clusterv1.MachineSpec{
107107
ClusterName: capiCluster.Name,
108108
Bootstrap: clusterv1.Bootstrap{
109-
ConfigRef: &clusterv1.ContractVersionedObjectReference{
109+
ConfigRef: clusterv1.ContractVersionedObjectReference{
110110
APIGroup: "bootstrap.cluster.x-k8s.io",
111111
Kind: "BootstrapConfig",
112112
Name: "does-no-ext", // Does not have to exist for these tests.
@@ -238,7 +238,7 @@ func Test_machineReconciler_Metadata(t *testing.T) {
238238
Namespace: ns.Name,
239239
},
240240
Spec: clusterv1.ClusterSpec{
241-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
241+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
242242
APIGroup: "infrastructure.cluster.x-k8s.io",
243243
Kind: "VSphereCluster",
244244
Name: "vsphere-test1",

controllers/vspherevm_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ func (r vmReconciler) retrieveVcenterSession(ctx context.Context, vsphereVM *inf
670670
return session.GetOrCreate(ctx, params)
671671
}
672672

673-
if cluster.Spec.InfrastructureRef == nil {
673+
if !cluster.Spec.InfrastructureRef.IsDefined() {
674674
return nil, errors.Errorf("cannot retrieve vCenter session for cluster %s: Cluster.spec.infrastructureRef is nil", klog.KObj(cluster))
675675
}
676676
key := ctrlclient.ObjectKey{

controllers/vspherevm_controller_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func TestReconcileNormal_WaitingForIPAddrAllocation(t *testing.T) {
8888
Namespace: "test",
8989
},
9090
Spec: clusterv1.ClusterSpec{
91-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
91+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
9292
Name: vsphereCluster.Name,
9393
},
9494
},
@@ -476,7 +476,7 @@ func TestRetrievingVCenterCredentialsFromCluster(t *testing.T) {
476476
Namespace: "test",
477477
},
478478
Spec: clusterv1.ClusterSpec{
479-
InfrastructureRef: &clusterv1.ContractVersionedObjectReference{
479+
InfrastructureRef: clusterv1.ContractVersionedObjectReference{
480480
Name: vsphereCluster.Name,
481481
},
482482
},
@@ -514,9 +514,9 @@ func TestRetrievingVCenterCredentialsFromCluster(t *testing.T) {
514514
Namespace: "test",
515515
},
516516

517-
// InfrastructureRef is nil so we should get an error.
517+
// InfrastructureRef is not set so we should get an error.
518518
Spec: clusterv1.ClusterSpec{
519-
InfrastructureRef: nil,
519+
// InfrastructureRef not set.
520520
},
521521
}
522522
initObjs := createMachineOwnerHierarchy(machine)

0 commit comments

Comments
 (0)