MCPcopy Index your code
hub / github.com/aws/aws-node-termination-handler / fetchAllPods

Method fetchAllPods

pkg/node/node.go:712–724  ·  view source on GitHub ↗
(nodeName string)

Source from the content-addressed store, hash-verified

710}
711
712func (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
727func (n *Node) FilterOutDaemonSetPods(pods *corev1.PodList) *corev1.PodList {

Callers 2

CordonAndDrainMethod · 0.95
FetchPodNameListMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected