Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ssttehrani committed Apr 6, 2024
1 parent ba13acb commit 233c497
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/controller/service/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ func (re *ReconcilerExtended) addFinalizer(ctx context.Context) (*ctrl.Result, e
if err := re.Client.Get(ctx, re.request.NamespacedName, re.service); err != nil {
return err
}

if controllerutil.ContainsFinalizer(re.service, consts.ServiceFinalizerString) {
return nil
}

controllerutil.AddFinalizer(re.service, consts.ServiceFinalizerString)

return re.Client.Update(ctx, re.service)
Expand All @@ -268,9 +270,11 @@ func (re *ReconcilerExtended) removeFinalizer(ctx context.Context) (*ctrl.Result
if err := re.Client.Get(ctx, re.request.NamespacedName, re.service); err != nil {
return err
}

if !controllerutil.ContainsFinalizer(re.service, consts.ServiceFinalizerString) {
return nil
}

controllerutil.RemoveFinalizer(re.service, consts.ServiceFinalizerString)

return re.Client.Update(ctx, re.service)
Expand Down

0 comments on commit 233c497

Please sign in to comment.