Allow using kube-apiserver cache for pod list requests by hieurender · Pull Request #1018 · aws/aws-node-termination-handler

@LikithaVemulapalli added the test you asked for.

I also added a second commit, as even with the first commit we noticed NTH was still doing quorum-lists of pods. We traced the source to the call drain.RunNodeDrain, which calls drainer.GetPodsForDeletion, which does not set ResourceVersion=0 in its ListOptions:

	podList := &corev1.PodList{}
	initialOpts := &metav1.ListOptions{
		LabelSelector: labelSelector.String(),
		FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": nodeName}).String(),
		Limit:         d.ChunkSize,
	}

It was fairly straightforward to refactor so that we don't call this function.