@@ -122,7 +122,7 @@ func (r *ClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ct
122122
123123 // Fetch the IPAddressClaim
124124 claim := & ipamv1.IPAddressClaim {}
125- if err := r .Client . Get (ctx , req .NamespacedName , claim ); err != nil {
125+ if err := r .Get (ctx , req .NamespacedName , claim ); err != nil {
126126 if apierrors .IsNotFound (err ) {
127127 return ctrl.Result {}, nil
128128 }
@@ -139,13 +139,13 @@ func (r *ClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ct
139139 }
140140 if err != nil {
141141 if apierrors .IsNotFound (err ) {
142- if ! claim .ObjectMeta . DeletionTimestamp .IsZero () {
142+ if ! claim .DeletionTimestamp .IsZero () {
143143 patch := client .MergeFrom (claim .DeepCopy ())
144144 if err := r .reconcileDelete (ctx , claim ); err != nil {
145145 return ctrl.Result {}, fmt .Errorf ("reconcile delete: %w" , err )
146146 }
147147 // we'll need to explicitly patch the claim here since we haven't set up a patch helper yet.
148- if err := r .Client . Patch (ctx , claim , patch ); err != nil {
148+ if err := r .Patch (ctx , claim , patch ); err != nil {
149149 return ctrl.Result {}, fmt .Errorf ("patch after reconciling delete: %w" , err )
150150 }
151151 return ctrl.Result {}, nil
@@ -187,7 +187,7 @@ func (r *ClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ct
187187 if apierrors .IsNotFound (err ) {
188188 err := errors .New ("pool not found" )
189189 log .Error (err , "the referenced pool could not be found" )
190- if ! claim .ObjectMeta . DeletionTimestamp .IsZero () {
190+ if ! claim .DeletionTimestamp .IsZero () {
191191 return ctrl.Result {}, r .reconcileDelete (ctx , claim )
192192 }
193193 return ctrl.Result {}, nil
@@ -207,7 +207,7 @@ func (r *ClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ct
207207 }
208208
209209 // If the claim is marked for deletion, release the address.
210- if ! claim .ObjectMeta . DeletionTimestamp .IsZero () {
210+ if ! claim .DeletionTimestamp .IsZero () {
211211 if res , err := handler .ReleaseAddress (ctx ); err != nil {
212212 return unwrapResult (res ), err
213213 }
@@ -267,21 +267,21 @@ func (r *ClaimReconciler) reconcileDelete(ctx context.Context, claim *ipamv1.IPA
267267 Namespace : claim .Namespace ,
268268 Name : claim .Name ,
269269 }
270- if err := r .Client . Get (ctx , namespacedName , address ); err != nil && ! apierrors .IsNotFound (err ) {
270+ if err := r .Get (ctx , namespacedName , address ); err != nil && ! apierrors .IsNotFound (err ) {
271271 return errors .Wrap (err , "failed to fetch address" )
272272 }
273273
274274 if address .Name != "" {
275275 var err error
276276 patch := client .MergeFrom (address .DeepCopy ())
277277 if controllerutil .RemoveFinalizer (address , ProtectAddressFinalizer ) {
278- if err = r .Client . Patch (ctx , address , patch ); err != nil && ! apierrors .IsNotFound (err ) {
278+ if err = r .Patch (ctx , address , patch ); err != nil && ! apierrors .IsNotFound (err ) {
279279 return errors .Wrap (err , "failed to remove address finalizer" )
280280 }
281281 }
282282
283283 if err == nil {
284- if err := r .Client . Delete (ctx , address ); err != nil && ! apierrors .IsNotFound (err ) {
284+ if err := r .Delete (ctx , address ); err != nil && ! apierrors .IsNotFound (err ) {
285285 return err
286286 }
287287 }
@@ -294,7 +294,7 @@ func (r *ClaimReconciler) reconcileDelete(ctx context.Context, claim *ipamv1.IPA
294294func (r * ClaimReconciler ) clusterToIPClaims (_ context.Context , a client.Object ) []reconcile.Request {
295295 requests := []reconcile.Request {}
296296 claims := & ipamv1.IPAddressClaimList {}
297- if err := r .Client . List (context .Background (), claims , client.MatchingFields {"clusterName" : a .GetName ()}); err != nil {
297+ if err := r .List (context .Background (), claims , client.MatchingFields {"clusterName" : a .GetName ()}); err != nil {
298298 return requests
299299 }
300300 for _ , c := range claims .Items {
0 commit comments