From 4aebcacd26547e9a10b98202722fce0a71dcd4c8 Mon Sep 17 00:00:00 2001 From: Garvin Pang Date: Tue, 22 Oct 2024 18:15:07 -0700 Subject: [PATCH] Add byobject filter on nodes (#2888) * Add byobject filter on nodes --------- Co-authored-by: Jayanth Varavani <1111446+jayanthvn@users.noreply.github.com> Co-authored-by: Garvin Pang --- pkg/k8sapi/k8sutils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/k8sapi/k8sutils.go b/pkg/k8sapi/k8sutils.go index 6d4c9dcc07..4ebac0ab69 100644 --- a/pkg/k8sapi/k8sutils.go +++ b/pkg/k8sapi/k8sutils.go @@ -37,7 +37,11 @@ func getIPAMDCacheFilters() map[client.Object]cache.ByObject { return map[client.Object]cache.ByObject{ &corev1.Pod{}: { Field: fields.Set{"spec.nodeName": nodeName}.AsSelector(), - }} + }, + &corev1.Node{}: { + Field: fields.Set{"metadata.name": nodeName}.AsSelector(), + }, + } } return nil }