Skip to content

Commit d88b266

Browse files
committed
filter irrelevant pod in pod_reconciler
1 parent 92431f5 commit d88b266

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/epp/controller/pod_reconciler.go

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
ctrl "sigs.k8s.io/controller-runtime"
2828
"sigs.k8s.io/controller-runtime/pkg/client"
2929
"sigs.k8s.io/controller-runtime/pkg/log"
30+
"sigs.k8s.io/controller-runtime/pkg/predicate"
3031
"sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2"
3132
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/datastore"
3233
logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging"
@@ -67,6 +68,9 @@ func (c *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
6768
func (c *PodReconciler) SetupWithManager(mgr ctrl.Manager) error {
6869
return ctrl.NewControllerManagedBy(mgr).
6970
For(&corev1.Pod{}).
71+
WithEventFilter(predicate.NewPredicateFuncs(func(pod client.Object) bool {
72+
return c.Datastore.PoolLabelsMatch(pod.GetLabels())
73+
})).
7074
Complete(c)
7175
}
7276

0 commit comments

Comments
 (0)