Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete outdated upgrade procedures #162

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading