Skip to content

Commit 1e76d43

Browse files
nirrozenbaumkfswain
authored andcommitted
predicate follow up PR to remove the check from Reconcile func (kubernetes-sigs#418)
* 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]>
1 parent fdef0ea commit 1e76d43

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

pkg/epp/controller/inferencemodel_reconciler.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ type InferenceModelReconciler struct {
4343
}
4444

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

5249
logger.Info("Reconciling InferenceModel")

pkg/epp/controller/inferencemodel_reconciler_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ var (
8585
ModelName("fake model2").
8686
CreationTimestamp(metav1.Unix(1000, 0)).
8787
PoolName(pool.Name).ObjRef()
88-
infModel2NS2 = utiltest.MakeInferenceModel(infModel2.Name).
89-
Namespace("ns2").
90-
ModelName(infModel2.Spec.ModelName).
91-
CreationTimestamp(metav1.Unix(1000, 0)).
92-
PoolName(pool.Name).ObjRef()
9388
)
9489

9590
func TestInferenceModelReconciler(t *testing.T) {
@@ -131,12 +126,6 @@ func TestInferenceModelReconciler(t *testing.T) {
131126
model: infModel1NS2,
132127
wantModels: []*v1alpha2.InferenceModel{infModel1},
133128
},
134-
{
135-
name: "Model referencing a different pool, same pool name but different namespace",
136-
modelsInStore: []*v1alpha2.InferenceModel{infModel1},
137-
model: infModel2NS2,
138-
wantModels: []*v1alpha2.InferenceModel{infModel1},
139-
},
140129
{
141130
name: "Existing model changed pools, replaced with another",
142131
modelsInStore: []*v1alpha2.InferenceModel{infModel1},

0 commit comments

Comments
 (0)