From c1307099669b7e8090a44be9e8635e5e88d650b4 Mon Sep 17 00:00:00 2001 From: Garvin Pang Date: Thu, 18 Apr 2024 13:51:20 -0700 Subject: [PATCH 1/2] Add byobject filter on nodes --- 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..2355f75a8a 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 } From 1f2d6fc636583db18e0f3b828ac1a883ffc9d1de Mon Sep 17 00:00:00 2001 From: Garvin Pang Date: Thu, 10 Oct 2024 20:05:58 -0700 Subject: [PATCH 2/2] format --- pkg/k8sapi/k8sutils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/k8sapi/k8sutils.go b/pkg/k8sapi/k8sutils.go index 2355f75a8a..4ebac0ab69 100644 --- a/pkg/k8sapi/k8sutils.go +++ b/pkg/k8sapi/k8sutils.go @@ -38,7 +38,7 @@ func getIPAMDCacheFilters() map[client.Object]cache.ByObject { &corev1.Pod{}: { Field: fields.Set{"spec.nodeName": nodeName}.AsSelector(), }, - &corev1.Node{}: { + &corev1.Node{}: { Field: fields.Set{"metadata.name": nodeName}.AsSelector(), }, }