Skip to content

Commit

Permalink
Merge pull request #162 from Kuadrant/delete-old-upgrade-procedures
Browse files Browse the repository at this point in the history
delete outdated upgrade procedures
  • Loading branch information
eguzki authored Oct 1, 2024
2 parents 41baa87 + c4098ca commit 641345e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 284 deletions.
26 changes: 7 additions & 19 deletions controllers/limitador_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
limitadorv1alpha1 "github.com/kuadrant/limitador-operator/api/v1alpha1"
"github.com/kuadrant/limitador-operator/pkg/limitador"
"github.com/kuadrant/limitador-operator/pkg/reconcilers"
"github.com/kuadrant/limitador-operator/pkg/upgrades"
)

// LimitadorReconciler reconciles a Limitador object
Expand Down Expand Up @@ -117,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 @@ -206,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 @@ -246,16 +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
}

// TODO: To be deleted when the upgrade path is no longer needed.
return upgrades.UpgradeDeploymentTov070(ctx, r.Client(), limitadorObj, client.ObjectKeyFromObject(deployment))
return nil
}

func (r *LimitadorReconciler) reconcileService(ctx context.Context, limitadorObj *limitadorv1alpha1.Limitador) error {
Expand Down Expand Up @@ -324,12 +318,6 @@ func (r *LimitadorReconciler) reconcileLimitsConfigMap(ctx context.Context, limi
return err
}

// TODO: To be deleted when the upgrade path is no longer needed.
err = upgrades.UpgradeConfigMapTov070(ctx, r.Client(), limitadorObj)
if err != nil {
return err
}

return nil
}

Expand Down
77 changes: 0 additions & 77 deletions pkg/upgrades/v0_7_0.go

This file was deleted.

188 changes: 0 additions & 188 deletions pkg/upgrades/v0_7_0_test.go

This file was deleted.

0 comments on commit 641345e

Please sign in to comment.