From d5a77ee9b77702979deb3a46e068e67b881a32fc Mon Sep 17 00:00:00 2001 From: TwiN Date: Thu, 6 Oct 2022 18:23:40 -0400 Subject: [PATCH] fix: Significantly reduce time to retrieve pods from node --- k8s/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/k8s/client.go b/k8s/client.go index ecc8829f..64312b19 100644 --- a/k8s/client.go +++ b/k8s/client.go @@ -70,7 +70,8 @@ func (k *Client) GetNodes() ([]v1.Node, error) { // GetPodsInNode retrieves all pods from a given node func (k *Client) GetPodsInNode(node string) ([]v1.Pod, error) { podList, err := k.client.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{ - FieldSelector: "spec.nodeName=" + node, + FieldSelector: "spec.nodeName=" + node, + ResourceVersion: "0", }) if err != nil { return nil, err