Skip to content

Commit

Permalink
predicate follow up PR to remove the check from Reconcile func (#418)
Browse files Browse the repository at this point in the history
* predicate follow up PR to remove the check from Reconcile func

Signed-off-by: Nir Rozenbaum <[email protected]>

* removed irrelevant test after introducing predicate

Signed-off-by: Nir Rozenbaum <[email protected]>

---------

Signed-off-by: Nir Rozenbaum <[email protected]>
  • Loading branch information
nirrozenbaum authored Feb 27, 2025
1 parent 29bf32d commit d2c6e7a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
5 changes: 1 addition & 4 deletions pkg/epp/controller/inferencemodel_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ type InferenceModelReconciler struct {
}

func (c *InferenceModelReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
if req.Namespace != c.PoolNamespacedName.Namespace {
return ctrl.Result{}, nil
}
logger := log.FromContext(ctx).V(logutil.DEFAULT).WithValues("inferenceModel", req.Name)
logger := log.FromContext(ctx).V(logutil.DEFAULT).WithValues("inferenceModel", req.NamespacedName)
ctx = ctrl.LoggerInto(ctx, logger)

logger.Info("Reconciling InferenceModel")
Expand Down
11 changes: 0 additions & 11 deletions pkg/epp/controller/inferencemodel_reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ var (
ModelName("fake model2").
CreationTimestamp(metav1.Unix(1000, 0)).
PoolName(pool.Name).ObjRef()
infModel2NS2 = utiltest.MakeInferenceModel(infModel2.Name).
Namespace("ns2").
ModelName(infModel2.Spec.ModelName).
CreationTimestamp(metav1.Unix(1000, 0)).
PoolName(pool.Name).ObjRef()
)

func TestInferenceModelReconciler(t *testing.T) {
Expand Down Expand Up @@ -131,12 +126,6 @@ func TestInferenceModelReconciler(t *testing.T) {
model: infModel1NS2,
wantModels: []*v1alpha2.InferenceModel{infModel1},
},
{
name: "Model referencing a different pool, same pool name but different namespace",
modelsInStore: []*v1alpha2.InferenceModel{infModel1},
model: infModel2NS2,
wantModels: []*v1alpha2.InferenceModel{infModel1},
},
{
name: "Existing model changed pools, replaced with another",
modelsInStore: []*v1alpha2.InferenceModel{infModel1},
Expand Down

0 comments on commit d2c6e7a

Please sign in to comment.