From 2d8fdff140c31abfa3533694301d4d0a2ad7bc42 Mon Sep 17 00:00:00 2001 From: Anton Chaporgin Date: Thu, 10 Oct 2024 18:20:18 +0300 Subject: [PATCH] try to apply patch to new version --- cluster-autoscaler/ca.patch | 74 +++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/cluster-autoscaler/ca.patch b/cluster-autoscaler/ca.patch index 9b9b49772..4cd30b5d0 100644 --- a/cluster-autoscaler/ca.patch +++ b/cluster-autoscaler/ca.patch @@ -1,44 +1,64 @@ diff --git a/cluster-autoscaler/utils/kubernetes/listers.go b/cluster-autoscaler/utils/kubernetes/listers.go -index d0033550f..fa3c2ec30 100644 ---- a/cluster-autoscaler/utils/kubernetes/listers.go -+++ b/cluster-autoscaler/utils/kubernetes/listers.go -@@ -17,14 +17,19 @@ limitations under the License. +--- a/cluster-autoscaler/utils/kubernetes/listers.go (revision daeb681311f0d14688e499ba59e8c43ee089e7da) ++++ b/cluster-autoscaler/utils/kubernetes/listers.go (date 1728573355649) +@@ -17,21 +17,26 @@ package kubernetes - + import ( -+ "encoding/json" - "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/api/resource" -+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" -+ "k8s.io/apimachinery/pkg/runtime" -+ "k8s.io/apimachinery/pkg/watch" - client "k8s.io/client-go/kubernetes" - v1appslister "k8s.io/client-go/listers/apps/v1" - v1batchlister "k8s.io/client-go/listers/batch/v1" -@@ -185,6 +190,7 @@ func NewUnschedulablePodInNamespaceLister(kubeClient client.Interface, namespace - selector := fields.ParseSelectorOrDie("spec.nodeName==" + "" + ",status.phase!=" + +- "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 @@ + selector := fields.ParseSelectorOrDie("spec.nodeName!=" + "" + ",status.phase!=" + string(apiv1.PodSucceeded) + ",status.phase!=" + string(apiv1.PodFailed)) - podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", namespace, selector) + podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", apiv1.NamespaceAll, selector) + podListWatch = wrapListWatchWithNeonVMUsage(podListWatch) store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(podListWatch, &apiv1.Pod{}, time.Hour) podLister := v1lister.NewPodLister(store) go reflector.Run(stopchannel) -@@ -209,6 +215,7 @@ func NewScheduledPodLister(kubeClient client.Interface, stopchannel <-chan struc - selector := fields.ParseSelectorOrDie("spec.nodeName!=" + "" + ",status.phase!=" + +@@ -212,6 +218,7 @@ + selector := fields.ParseSelectorOrDie("status.phase!=" + string(apiv1.PodSucceeded) + ",status.phase!=" + string(apiv1.PodFailed)) podListWatch := cache.NewListWatchFromClient(kubeClient.CoreV1().RESTClient(), "pods", apiv1.NamespaceAll, selector) + podListWatch = wrapListWatchWithNeonVMUsage(podListWatch) store, reflector := cache.NewNamespaceKeyedIndexerAndReflector(podListWatch, &apiv1.Pod{}, time.Hour) podLister := v1lister.NewPodLister(store) go reflector.Run(stopchannel) -@@ -218,6 +225,105 @@ func NewScheduledPodLister(kubeClient client.Interface, stopchannel <-chan struc +@@ -221,6 +228,105 @@ } }