Skip to content

Commit

Permalink
cluster-autoscaler: Fix patch so results are formatted
Browse files Browse the repository at this point in the history
This is a follow-up to #1134, to return the formatting to:

1. Move imports so that the standard library remains in a
   newline-separated group by itself.
2. Use 'git diff' between commits — this results in the changes to
   context markers to show the function names, plus the simpler header.
  • Loading branch information
sharnoff committed Nov 15, 2024
1 parent 59f6746 commit f835226
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions cluster-autoscaler/ca.patch
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
diff --git a/cluster-autoscaler/utils/kubernetes/listers.go b/cluster-autoscaler/utils/kubernetes/listers.go
--- a/cluster-autoscaler/utils/kubernetes/listers.go (revision 6a3cf228856724a44fb66f0e2274ebf75e89e6e9)
+++ b/cluster-autoscaler/utils/kubernetes/listers.go (date 1730896304084)
@@ -17,6 +17,11 @@
index 198fdfb37..d534fc1ef 100644
--- a/cluster-autoscaler/utils/kubernetes/listers.go
+++ b/cluster-autoscaler/utils/kubernetes/listers.go
@@ -17,14 +17,19 @@ limitations under the License.
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"
"time"

appsv1 "k8s.io/api/apps/v1"
@@ -169,6 +174,7 @@
client "k8s.io/client-go/kubernetes"
v1appslister "k8s.io/client-go/listers/apps/v1"
v1batchlister "k8s.io/client-go/listers/batch/v1"
@@ -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 f835226

Please sign in to comment.