Skip to content

Commit

Permalink
REMOVE: kuadrant controller management of limitador (#888)
Browse files Browse the repository at this point in the history
* REMOVE: kuadrant controller management of limitador

With the move to the state of the world reconcile the kuadrant
controller no longer needs to reconcile the creation of the limitador

* FIX: Adding back watches

The status reconcile needs to watch the resources for chances.

---------

Signed-off-by: Jim Fitzpatrick <[email protected]>
  • Loading branch information
Boomatang authored Oct 14, 2024
1 parent 9dac15e commit 45efe5d
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions controllers/kuadrant_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"

"github.com/go-logr/logr"
authorinov1beta1 "github.com/kuadrant/authorino-operator/api/v1beta1"
limitadorv1alpha1 "github.com/kuadrant/limitador-operator/api/v1alpha1"
iopv1alpha1 "istio.io/istio/operator/pkg/apis/istio/v1alpha1"
corev1 "k8s.io/api/core/v1"
Expand All @@ -36,7 +37,6 @@ import (
maistrav1 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v1"
maistrav2 "github.com/kuadrant/kuadrant-operator/api/external/maistra/v2"
kuadrantv1beta1 "github.com/kuadrant/kuadrant-operator/api/v1beta1"
"github.com/kuadrant/kuadrant-operator/pkg/common"
"github.com/kuadrant/kuadrant-operator/pkg/istio"
kuadrantgatewayapi "github.com/kuadrant/kuadrant-operator/pkg/library/gatewayapi"
"github.com/kuadrant/kuadrant-operator/pkg/library/reconcilers"
Expand Down Expand Up @@ -394,32 +394,7 @@ func (r *KuadrantReconciler) registerServiceMeshMember(ctx context.Context, kObj
}

func (r *KuadrantReconciler) reconcileSpec(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error {
if err := r.registerExternalAuthorizer(ctx, kObj); err != nil {
return err
}

return r.reconcileLimitador(ctx, kObj)
}

func (r *KuadrantReconciler) reconcileLimitador(ctx context.Context, kObj *kuadrantv1beta1.Kuadrant) error {
limitador := &limitadorv1alpha1.Limitador{
TypeMeta: metav1.TypeMeta{
Kind: "Limitador",
APIVersion: "limitador.kuadrant.io/v1alpha1",
},
ObjectMeta: metav1.ObjectMeta{
Name: common.LimitadorName,
Namespace: kObj.Namespace,
},
Spec: limitadorv1alpha1.LimitadorSpec{},
}

err := r.SetOwnerReference(kObj, limitador)
if err != nil {
return err
}

return r.ReconcileResource(ctx, &limitadorv1alpha1.Limitador{}, limitador, reconcilers.CreateOnlyMutator)
return r.registerExternalAuthorizer(ctx, kObj)
}

// SetupWithManager sets up the controller with the Manager.
Expand All @@ -436,5 +411,6 @@ func (r *KuadrantReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&kuadrantv1beta1.Kuadrant{}).
Owns(&limitadorv1alpha1.Limitador{}).
Owns(&authorinov1beta1.Authorino{}).
Complete(r)
}

0 comments on commit 45efe5d

Please sign in to comment.