Skip to content

Commit

Permalink
Formatted patch
Browse files Browse the repository at this point in the history
  • Loading branch information
edude03 committed Nov 1, 2024
1 parent a930a1f commit b5007c0
Showing 1 changed file with 22 additions and 44 deletions.
66 changes: 22 additions & 44 deletions cluster-autoscaler/ca.patch
Original file line number Diff line number Diff line change
@@ -1,64 +1,42 @@
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)
+ podListWatch = wrapListWatchWithNeonVMUsage(podListWatch)
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)
+ podListWatch = wrapListWatchWithNeonVMUsage(podListWatch)
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
}
}

Expand Down

0 comments on commit b5007c0

Please sign in to comment.