Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
  • Loading branch information
eguzki committed Oct 1, 2024
1 parent a1b016d commit c4098ca
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions controllers/limitador_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@ func (r *LimitadorReconciler) reconcileSpec(ctx context.Context, limitadorObj *l
return ctrl.Result{}, err
}

result, err := r.reconcileDeployment(ctx, limitadorObj)
if result.Requeue {
return result, nil
}
if err != nil {
if err := r.reconcileDeployment(ctx, limitadorObj); err != nil {
return ctrl.Result{}, err
}

Expand Down Expand Up @@ -205,15 +201,15 @@ func (r *LimitadorReconciler) reconcilePdb(ctx context.Context, limitadorObj *li
return nil
}

func (r *LimitadorReconciler) reconcileDeployment(ctx context.Context, limitadorObj *limitadorv1alpha1.Limitador) (ctrl.Result, error) {
func (r *LimitadorReconciler) reconcileDeployment(ctx context.Context, limitadorObj *limitadorv1alpha1.Limitador) error {
logger, err := logr.FromContext(ctx)
if err != nil {
return ctrl.Result{}, err
return err
}

deploymentOptions, err := r.getDeploymentOptions(ctx, limitadorObj)
if err != nil {
return ctrl.Result{}, err
return err
}

deploymentMutators := make([]reconcilers.DeploymentMutateFn, 0)
Expand Down Expand Up @@ -245,15 +241,15 @@ func (r *LimitadorReconciler) reconcileDeployment(ctx context.Context, limitador
deployment := limitador.Deployment(limitadorObj, deploymentOptions)
// controller reference
if err := r.SetOwnerReference(limitadorObj, deployment); err != nil {
return ctrl.Result{}, err
return err
}
err = r.ReconcileDeployment(ctx, deployment, reconcilers.DeploymentMutator(deploymentMutators...))
logger.V(1).Info("reconcile deployment", "error", err)
if err != nil {
return ctrl.Result{}, err
return err
}

return ctrl.Result{}, nil
return nil
}

func (r *LimitadorReconciler) reconcileService(ctx context.Context, limitadorObj *limitadorv1alpha1.Limitador) error {
Expand Down

0 comments on commit c4098ca

Please sign in to comment.