Skip to content

Commit

Permalink
Filter for pods in Running status only
Browse files Browse the repository at this point in the history
  • Loading branch information
Eyal Zekaria committed Aug 3, 2020
1 parent 91cadde commit 70e0fd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/iexec/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// get all pods from kubernetes API
func getAllPods(client kubernetes.Interface, namespace string) (*corev1.PodList, error) {
pods, err := client.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})
pods, err := client.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{FieldSelector: "status.phase=Running"})
if err != nil {
return pods, err
}
Expand Down

0 comments on commit 70e0fd7

Please sign in to comment.