(nodeName string)
| 710 | } |
| 711 | |
| 712 | func (n Node) fetchAllPods(nodeName string) (*corev1.PodList, error) { |
| 713 | if n.nthConfig.DryRun { |
| 714 | log.Info().Msgf("Would have retrieved running pod list on node %s, but dry-run flag was set", nodeName) |
| 715 | return &corev1.PodList{}, nil |
| 716 | } |
| 717 | listOptions := metav1.ListOptions{ |
| 718 | FieldSelector: "spec.nodeName=" + nodeName, |
| 719 | } |
| 720 | if n.nthConfig.UseAPIServerCacheToListPods { |
| 721 | listOptions.ResourceVersion = "0" |
| 722 | } |
| 723 | return n.drainHelper.Client.CoreV1().Pods("").List(context.TODO(), listOptions) |
| 724 | } |
| 725 | |
| 726 | // FilterOutDaemonSetPods filters a list of pods to exclude DaemonSet pods when IgnoreDaemonSets is enabled |
| 727 | func (n *Node) FilterOutDaemonSetPods(pods *corev1.PodList) *corev1.PodList { |
no outgoing calls
no test coverage detected