Skip to content

Commit

Permalink
Merge pull request kubernetes#5177 from voelzmo/fix/updater-podlist-n…
Browse files Browse the repository at this point in the history
…amespacing

Restrict Updater PodLister to namespace
  • Loading branch information
k8s-ci-robot authored Sep 26, 2022
2 parents 51beced + fb50d0b commit f880740
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vertical-pod-autoscaler/pkg/updater/logic/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func filterDeletedPods(pods []*apiv1.Pod) []*apiv1.Pod {
func newPodLister(kubeClient kube_client.Interface, namespace string) v1lister.PodLister {
selector := fields.ParseSelectorOrDie("spec.nodeName!=" + "" + ",status.phase!=" +
string(apiv1.PodSucceeded) + ",status.phase!=" + string(apiv1.PodFailed))
podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", apiv1.NamespaceAll, selector)
podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", namespace, selector)
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
podLister := v1lister.NewPodLister(store)
podReflector := cache.NewReflector(podListWatch, &apiv1.Pod{}, store, time.Hour)
Expand Down

0 comments on commit f880740

Please sign in to comment.