@@ -34,7 +34,7 @@ import (
3434 "k8s.io/client-go/rest"
3535 "k8s.io/klog/v2"
3636 "k8s.io/utils/ptr"
37- clusterv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1 "
37+ clusterv1 "sigs.k8s.io/cluster-api/api/v1beta2 "
3838 "sigs.k8s.io/controller-runtime/pkg/cache"
3939 "sigs.k8s.io/controller-runtime/pkg/client"
4040 "sigs.k8s.io/controller-runtime/pkg/config"
@@ -62,7 +62,7 @@ const (
6262
6363// newInfraCluster returns an Infra cluster with the same name as the target
6464// cluster.
65- func newInfraCluster (namespace string , cluster * clusterv1beta1 .Cluster ) client.Object {
65+ func newInfraCluster (namespace string , cluster * clusterv1 .Cluster ) client.Object {
6666 return & vmwarev1.VSphereCluster {
6767 ObjectMeta : metav1.ObjectMeta {
6868 Name : cluster .Name ,
@@ -86,7 +86,7 @@ func newAnonInfraCluster(namespace string) client.Object {
8686
8787// newInfraMachine creates an Infra machine with the same name as the target
8888// machine.
89- func newInfraMachine (namespace string , machine * clusterv1beta1 .Machine ) client.Object {
89+ func newInfraMachine (namespace string , machine * clusterv1 .Machine ) client.Object {
9090 return & vmwarev1.VSphereMachine {
9191 ObjectMeta : metav1.ObjectMeta {
9292 Name : machine .Name ,
@@ -127,16 +127,16 @@ func dropNamespace(namespace *corev1.Namespace, k8sClient client.Client) {
127127
128128// Creates and deploys a Cluster and VSphereCluster in order. Function does not
129129// block on VSphereCluster creation.
130- func deployCluster (namespace string , k8sClient client.Client ) (client.ObjectKey , * clusterv1beta1 .Cluster , client.Object ) {
130+ func deployCluster (namespace string , k8sClient client.Client ) (client.ObjectKey , * clusterv1 .Cluster , client.Object ) {
131131 // A finalizer is added to prevent it from being deleted until its
132132 // dependents are removed.
133- cluster := & clusterv1beta1 .Cluster {
133+ cluster := & clusterv1 .Cluster {
134134 ObjectMeta : metav1.ObjectMeta {
135135 GenerateName : "test-" ,
136136 Namespace : namespace ,
137137 Finalizers : []string {"test" },
138138 },
139- Spec : clusterv1beta1 .ClusterSpec {},
139+ Spec : clusterv1 .ClusterSpec {},
140140 }
141141 Expect (k8sClient .Create (ctx , cluster )).To (Succeed ())
142142
@@ -149,7 +149,7 @@ func deployCluster(namespace string, k8sClient client.Client) (client.ObjectKey,
149149 infraCluster := newInfraCluster (namespace , cluster )
150150 infraCluster .SetOwnerReferences ([]metav1.OwnerReference {
151151 {
152- APIVersion : clusterv1beta1 .GroupVersion .String (),
152+ APIVersion : clusterv1 .GroupVersion .String (),
153153 Kind : "Cluster" ,
154154 Name : cluster .Name ,
155155 UID : cluster .UID ,
@@ -162,28 +162,28 @@ func deployCluster(namespace string, k8sClient client.Client) (client.ObjectKey,
162162
163163// Creates and deploys a CAPI Machine. Function does not block on Machine
164164// creation.
165- func deployCAPIMachine (namespace string , cluster * clusterv1beta1 .Cluster , k8sClient client.Client ) (client.ObjectKey , * clusterv1beta1 .Machine ) {
165+ func deployCAPIMachine (namespace string , cluster * clusterv1 .Cluster , k8sClient client.Client ) (client.ObjectKey , * clusterv1 .Machine ) {
166166 // A finalizer is added to prevent it from being deleted until its
167167 // dependents are removed.
168- machine := & clusterv1beta1 .Machine {
168+ machine := & clusterv1 .Machine {
169169 ObjectMeta : metav1.ObjectMeta {
170170 GenerateName : "test-" ,
171171 Namespace : namespace ,
172172 Finalizers : []string {"test" },
173173 Labels : map [string ]string {
174- clusterv1beta1 .ClusterNameLabel : cluster .Name ,
175- clusterv1beta1 .MachineControlPlaneLabel : "" ,
174+ clusterv1 .ClusterNameLabel : cluster .Name ,
175+ clusterv1 .MachineControlPlaneLabel : "" ,
176176 },
177177 OwnerReferences : []metav1.OwnerReference {
178178 {
179- APIVersion : clusterv1beta1 .GroupVersion .String (),
179+ APIVersion : clusterv1 .GroupVersion .String (),
180180 Kind : "Cluster" ,
181181 Name : cluster .Name ,
182182 UID : cluster .UID ,
183183 },
184184 },
185185 },
186- Spec : clusterv1beta1 .MachineSpec {
186+ Spec : clusterv1 .MachineSpec {
187187 ClusterName : cluster .Name ,
188188 },
189189 }
@@ -194,11 +194,11 @@ func deployCAPIMachine(namespace string, cluster *clusterv1beta1.Cluster, k8sCli
194194
195195// Creates and deploys a VSphereMachine. Function does not block on Machine
196196// creation.
197- func deployInfraMachine (namespace string , machine * clusterv1beta1 .Machine , finalizers []string , k8sClient client.Client ) (client.ObjectKey , client.Object ) {
197+ func deployInfraMachine (namespace string , machine * clusterv1 .Machine , finalizers []string , k8sClient client.Client ) (client.ObjectKey , client.Object ) {
198198 infraMachine := newInfraMachine (namespace , machine )
199199 infraMachine .SetOwnerReferences ([]metav1.OwnerReference {
200200 {
201- APIVersion : clusterv1beta1 .GroupVersion .String (),
201+ APIVersion : clusterv1 .GroupVersion .String (),
202202 Kind : "Machine" ,
203203 Name : machine .Name ,
204204 UID : machine .UID ,
@@ -212,7 +212,7 @@ func deployInfraMachine(namespace string, machine *clusterv1beta1.Machine, final
212212
213213// Updates the InfrastructureRef of a CAPI Cluster to a VSphereCluster. Function
214214// does not block on update success.
215- func updateClusterInfraRef (cluster * clusterv1beta1 .Cluster , infraCluster client.Object , k8sClient client.Client ) {
215+ func updateClusterInfraRef (cluster * clusterv1 .Cluster , infraCluster client.Object , k8sClient client.Client ) {
216216 cluster .Spec .InfrastructureRef = & corev1.ObjectReference {
217217 APIVersion : infraCluster .GetObjectKind ().GroupVersionKind ().GroupVersion ().String (),
218218 Kind : infraCluster .GetObjectKind ().GroupVersionKind ().Kind ,
@@ -551,13 +551,13 @@ var _ = Describe("Reconciliation tests", func() {
551551 By ("Create the CAPI Machine and wait for it to exist" )
552552 // A finalizer is added to prevent it from being deleted until its
553553 // dependents are removed.
554- machine := & clusterv1beta1 .Machine {
554+ machine := & clusterv1 .Machine {
555555 ObjectMeta : metav1.ObjectMeta {
556556 GenerateName : "test-" ,
557557 Namespace : ns .Name ,
558558 Finalizers : []string {"test" },
559559 },
560- Spec : clusterv1beta1 .MachineSpec {
560+ Spec : clusterv1 .MachineSpec {
561561 ClusterName : "crud" ,
562562 },
563563 }
0 commit comments