Skip to content

Commit

Permalink
fix: Significantly reduce time to retrieve pods from node
Browse files Browse the repository at this point in the history
  • Loading branch information
TwiN committed Oct 6, 2022
1 parent 8f0207a commit d5a77ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion k8s/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d5a77ee

Please sign in to comment.