Skip to content

Commit

Permalink
try to apply patch to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
chaporgin committed Oct 10, 2024
1 parent 1e0b372 commit 2d8fdff
Showing 1 changed file with 47 additions and 27 deletions.
74 changes: 47 additions & 27 deletions cluster-autoscaler/ca.patch
Original file line number Diff line number Diff line change
@@ -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 @@
}
}

Expand Down

0 comments on commit 2d8fdff

Please sign in to comment.