From b5007c0b449e39fbef8f0500cc1d8bee629161d2 Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Fri, 1 Nov 2024 14:45:30 -0400 Subject: [PATCH] Formatted patch --- cluster-autoscaler/ca.patch | 66 +++++++++++++------------------------ 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/cluster-autoscaler/ca.patch b/cluster-autoscaler/ca.patch index 4cd30b5d0..01ae57621 100644 --- a/cluster-autoscaler/ca.patch +++ b/cluster-autoscaler/ca.patch @@ -1,48 +1,26 @@ diff --git a/cluster-autoscaler/utils/kubernetes/listers.go b/cluster-autoscaler/utils/kubernetes/listers.go ---- a/cluster-autoscaler/utils/kubernetes/listers.go (revision daeb681311f0d14688e499ba59e8c43ee089e7da) -+++ b/cluster-autoscaler/utils/kubernetes/listers.go (date 1728573355649) -@@ -17,21 +17,26 @@ +index 198fdfb37..60bc062dc 100644 +--- a/cluster-autoscaler/utils/kubernetes/listers.go ++++ b/cluster-autoscaler/utils/kubernetes/listers.go +@@ -17,12 +17,17 @@ limitations under the License. package kubernetes - + import ( -- "time" -+ "encoding/json" -+ "k8s.io/apimachinery/pkg/api/resource" -+ "k8s.io/apimachinery/pkg/runtime" -+ "k8s.io/apimachinery/pkg/watch" -+ "time" - -- appsv1 "k8s.io/api/apps/v1" -- batchv1 "k8s.io/api/batch/v1" -- apiv1 "k8s.io/api/core/v1" -- policyv1 "k8s.io/api/policy/v1" -- "k8s.io/apimachinery/pkg/fields" -- "k8s.io/apimachinery/pkg/labels" -- client "k8s.io/client-go/kubernetes" -- v1appslister "k8s.io/client-go/listers/apps/v1" -- v1batchlister "k8s.io/client-go/listers/batch/v1" -- v1lister "k8s.io/client-go/listers/core/v1" -- v1policylister "k8s.io/client-go/listers/policy/v1" -- "k8s.io/client-go/tools/cache" -- podv1 "k8s.io/kubernetes/pkg/api/v1/pod" -+ appsv1 "k8s.io/api/apps/v1" -+ batchv1 "k8s.io/api/batch/v1" -+ apiv1 "k8s.io/api/core/v1" -+ policyv1 "k8s.io/api/policy/v1" -+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -+ "k8s.io/apimachinery/pkg/fields" -+ "k8s.io/apimachinery/pkg/labels" -+ client "k8s.io/client-go/kubernetes" -+ v1appslister "k8s.io/client-go/listers/apps/v1" -+ v1batchlister "k8s.io/client-go/listers/batch/v1" -+ v1lister "k8s.io/client-go/listers/core/v1" -+ v1policylister "k8s.io/client-go/listers/policy/v1" -+ "k8s.io/client-go/tools/cache" -+ podv1 "k8s.io/kubernetes/pkg/api/v1/pod" - ) - - // ListerRegistry is a registry providing various listers to list pods or nodes matching conditions -@@ -169,6 +174,7 @@ ++ "encoding/json" ++ "k8s.io/apimachinery/pkg/api/resource" ++ "k8s.io/apimachinery/pkg/runtime" ++ "k8s.io/apimachinery/pkg/watch" + "time" + + appsv1 "k8s.io/api/apps/v1" + batchv1 "k8s.io/api/batch/v1" + apiv1 "k8s.io/api/core/v1" + policyv1 "k8s.io/api/policy/v1" ++ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/labels" + client "k8s.io/client-go/kubernetes" +@@ -169,6 +174,7 @@ func NewScheduledPodLister(kubeClient client.Interface, stopchannel <-chan struc 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) @@ -50,7 +28,7 @@ diff --git a/cluster-autoscaler/utils/kubernetes/listers.go b/cluster-autoscaler store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(podListWatch, &apiv1.Pod{}, time.Hour) podLister := v1lister.NewPodLister(store) go reflector.Run(stopchannel) -@@ -212,6 +218,7 @@ +@@ -212,6 +218,7 @@ func NewScheduledAndUnschedulablePodLister(kubeClient client.Interface, stopchan selector := fields.ParseSelectorOrDie("status.phase!=" + string(apiv1.PodSucceeded) + ",status.phase!=" + string(apiv1.PodFailed)) podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", apiv1.NamespaceAll, selector) @@ -58,7 +36,7 @@ diff --git a/cluster-autoscaler/utils/kubernetes/listers.go b/cluster-autoscaler store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(podListWatch, &apiv1.Pod{}, time.Hour) podLister := v1lister.NewPodLister(store) go reflector.Run(stopchannel) -@@ -221,6 +228,105 @@ +@@ -221,6 +228,105 @@ func NewScheduledAndUnschedulablePodLister(kubeClient client.Interface, stopchan } }