@@ -35,7 +35,7 @@ import (
3535 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
3636 "sigs.k8s.io/controller-runtime/pkg/reconcile"
3737
38- infrastructurev1alpha3 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1alpha3 "
38+ infrastructurev1alpha4 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1alpha4 "
3939 "sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope"
4040 "sigs.k8s.io/cluster-api-provider-ibmcloud/pkg"
4141)
@@ -57,7 +57,7 @@ func (r *IBMVPCClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
5757
5858 // your logic here
5959 // Fetch the IBMVPCCluster instance
60- ibmCluster := & infrastructurev1alpha3 .IBMVPCCluster {}
60+ ibmCluster := & infrastructurev1alpha4 .IBMVPCCluster {}
6161 err := r .Get (ctx , req .NamespacedName , ibmCluster )
6262 if err != nil {
6363 if apierrors .IsNotFound (err ) {
@@ -111,8 +111,8 @@ func (r *IBMVPCClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
111111}
112112
113113func (r * IBMVPCClusterReconciler ) reconcile (ctx context.Context , clusterScope * scope.ClusterScope ) (ctrl.Result , error ) {
114- if ! controllerutil .ContainsFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha3 .ClusterFinalizer ) {
115- controllerutil .AddFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha3 .ClusterFinalizer )
114+ if ! controllerutil .ContainsFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha4 .ClusterFinalizer ) {
115+ controllerutil .AddFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha4 .ClusterFinalizer )
116116 //_ = r.Update(ctx, clusterScope.IBMVPCCluster)
117117 return ctrl.Result {}, nil
118118 }
@@ -122,7 +122,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s
122122 return ctrl.Result {}, errors .Wrapf (err , "failed to reconcile VPC for IBMVPCCluster %s/%s" , clusterScope .IBMVPCCluster .Namespace , clusterScope .IBMVPCCluster .Name )
123123 }
124124 if vpc != nil {
125- clusterScope .IBMVPCCluster .Status .VPC = infrastructurev1alpha3 .VPC {
125+ clusterScope .IBMVPCCluster .Status .VPC = infrastructurev1alpha4 .VPC {
126126 ID : * vpc .ID ,
127127 Name : * vpc .Name ,
128128 }
@@ -140,7 +140,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s
140140 Port : 6443 ,
141141 }
142142
143- clusterScope .IBMVPCCluster .Status .APIEndpoint = infrastructurev1alpha3 .APIEndpoint {
143+ clusterScope .IBMVPCCluster .Status .APIEndpoint = infrastructurev1alpha4 .APIEndpoint {
144144 Address : fip .Address ,
145145 FIPID : fip .ID ,
146146 }
@@ -153,7 +153,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s
153153 return ctrl.Result {}, errors .Wrapf (err , "failed to reconcile Subnet for IBMVPCCluster %s/%s" , clusterScope .IBMVPCCluster .Namespace , clusterScope .IBMVPCCluster .Name )
154154 }
155155 if subnet != nil {
156- clusterScope .IBMVPCCluster .Status .Subnet = infrastructurev1alpha3 .Subnet {
156+ clusterScope .IBMVPCCluster .Status .Subnet = infrastructurev1alpha4 .Subnet {
157157 Ipv4CidrBlock : subnet .Ipv4CIDRBlock ,
158158 Name : subnet .Name ,
159159 ID : subnet .ID ,
@@ -191,14 +191,14 @@ func (r *IBMVPCClusterReconciler) reconcileDelete(clusterScope *scope.ClusterSco
191191 if err := clusterScope .DeleteVPC (); err != nil {
192192 return ctrl.Result {}, errors .Wrap (err , "failed to delete VPC" )
193193 }
194- controllerutil .RemoveFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha3 .ClusterFinalizer )
194+ controllerutil .RemoveFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha4 .ClusterFinalizer )
195195 return ctrl.Result {}, nil
196196}
197197
198198// SetupWithManager creates a new IBMVPCCluster controller for a manager.
199199func (r * IBMVPCClusterReconciler ) SetupWithManager (mgr ctrl.Manager ) error {
200200 return ctrl .NewControllerManagedBy (mgr ).
201- For (& infrastructurev1alpha3 .IBMVPCCluster {}).
201+ For (& infrastructurev1alpha4 .IBMVPCCluster {}).
202202 WithEventFilter (predicates .ResourceIsNotExternallyManaged (ctrl .LoggerFrom (context .TODO ()))).
203203 Complete (r )
204204}
0 commit comments