@@ -35,7 +35,7 @@ import (
35
35
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
36
36
"sigs.k8s.io/controller-runtime/pkg/reconcile"
37
37
38
- infrastructurev1alpha3 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1alpha3 "
38
+ infrastructurev1alpha4 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1alpha4 "
39
39
"sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope"
40
40
"sigs.k8s.io/cluster-api-provider-ibmcloud/pkg"
41
41
)
@@ -57,7 +57,7 @@ func (r *IBMVPCClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
57
57
58
58
// your logic here
59
59
// Fetch the IBMVPCCluster instance
60
- ibmCluster := & infrastructurev1alpha3 .IBMVPCCluster {}
60
+ ibmCluster := & infrastructurev1alpha4 .IBMVPCCluster {}
61
61
err := r .Get (ctx , req .NamespacedName , ibmCluster )
62
62
if err != nil {
63
63
if apierrors .IsNotFound (err ) {
@@ -111,8 +111,8 @@ func (r *IBMVPCClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reques
111
111
}
112
112
113
113
func (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 )
116
116
//_ = r.Update(ctx, clusterScope.IBMVPCCluster)
117
117
return ctrl.Result {}, nil
118
118
}
@@ -122,7 +122,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s
122
122
return ctrl.Result {}, errors .Wrapf (err , "failed to reconcile VPC for IBMVPCCluster %s/%s" , clusterScope .IBMVPCCluster .Namespace , clusterScope .IBMVPCCluster .Name )
123
123
}
124
124
if vpc != nil {
125
- clusterScope .IBMVPCCluster .Status .VPC = infrastructurev1alpha3 .VPC {
125
+ clusterScope .IBMVPCCluster .Status .VPC = infrastructurev1alpha4 .VPC {
126
126
ID : * vpc .ID ,
127
127
Name : * vpc .Name ,
128
128
}
@@ -140,7 +140,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s
140
140
Port : 6443 ,
141
141
}
142
142
143
- clusterScope .IBMVPCCluster .Status .APIEndpoint = infrastructurev1alpha3 .APIEndpoint {
143
+ clusterScope .IBMVPCCluster .Status .APIEndpoint = infrastructurev1alpha4 .APIEndpoint {
144
144
Address : fip .Address ,
145
145
FIPID : fip .ID ,
146
146
}
@@ -153,7 +153,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s
153
153
return ctrl.Result {}, errors .Wrapf (err , "failed to reconcile Subnet for IBMVPCCluster %s/%s" , clusterScope .IBMVPCCluster .Namespace , clusterScope .IBMVPCCluster .Name )
154
154
}
155
155
if subnet != nil {
156
- clusterScope .IBMVPCCluster .Status .Subnet = infrastructurev1alpha3 .Subnet {
156
+ clusterScope .IBMVPCCluster .Status .Subnet = infrastructurev1alpha4 .Subnet {
157
157
Ipv4CidrBlock : subnet .Ipv4CIDRBlock ,
158
158
Name : subnet .Name ,
159
159
ID : subnet .ID ,
@@ -191,14 +191,14 @@ func (r *IBMVPCClusterReconciler) reconcileDelete(clusterScope *scope.ClusterSco
191
191
if err := clusterScope .DeleteVPC (); err != nil {
192
192
return ctrl.Result {}, errors .Wrap (err , "failed to delete VPC" )
193
193
}
194
- controllerutil .RemoveFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha3 .ClusterFinalizer )
194
+ controllerutil .RemoveFinalizer (clusterScope .IBMVPCCluster , infrastructurev1alpha4 .ClusterFinalizer )
195
195
return ctrl.Result {}, nil
196
196
}
197
197
198
198
// SetupWithManager creates a new IBMVPCCluster controller for a manager.
199
199
func (r * IBMVPCClusterReconciler ) SetupWithManager (mgr ctrl.Manager ) error {
200
200
return ctrl .NewControllerManagedBy (mgr ).
201
- For (& infrastructurev1alpha3 .IBMVPCCluster {}).
201
+ For (& infrastructurev1alpha4 .IBMVPCCluster {}).
202
202
WithEventFilter (predicates .ResourceIsNotExternallyManaged (ctrl .LoggerFrom (context .TODO ()))).
203
203
Complete (r )
204
204
}
0 commit comments