Skip to content

Commit

Permalink
Migrate to using api-specific REST clients
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Mar 7, 2019
1 parent 9248ced commit ea0d61f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cluster-autoscaler/utils/kubernetes/listers.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (lister *PodDisruptionBudgetListerImpl) List() ([]*policyv1.PodDisruptionBu

// NewPodDisruptionBudgetLister builds a pod disruption budget lister.
func NewPodDisruptionBudgetLister(kubeClient client.Interface, stopchannel <-chan struct{}) PodDisruptionBudgetLister {
listWatcher := cache.NewListWatchFromClient(kubeClient.Policy().RESTClient(), "poddisruptionbudgets", apiv1.NamespaceAll, fields.Everything())
listWatcher := cache.NewListWatchFromClient(kubeClient.PolicyV1beta1().RESTClient(), "poddisruptionbudgets", apiv1.NamespaceAll, fields.Everything())
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
pdbLister := v1policylister.NewPodDisruptionBudgetLister(store)
reflector := cache.NewReflector(listWatcher, &policyv1.PodDisruptionBudget{}, store, time.Hour)
Expand All @@ -313,7 +313,7 @@ func NewPodDisruptionBudgetLister(kubeClient client.Interface, stopchannel <-cha

// NewDaemonSetLister builds a daemonset lister.
func NewDaemonSetLister(kubeClient client.Interface, stopchannel <-chan struct{}) v1appslister.DaemonSetLister {
listWatcher := cache.NewListWatchFromClient(kubeClient.Apps().RESTClient(), "daemonsets", apiv1.NamespaceAll, fields.Everything())
listWatcher := cache.NewListWatchFromClient(kubeClient.AppsV1().RESTClient(), "daemonsets", apiv1.NamespaceAll, fields.Everything())
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
lister := v1appslister.NewDaemonSetLister(store)
reflector := cache.NewReflector(listWatcher, &appsv1.DaemonSet{}, store, time.Hour)
Expand All @@ -333,7 +333,7 @@ func NewReplicationControllerLister(kubeClient client.Interface, stopchannel <-c

// NewJobLister builds a job lister.
func NewJobLister(kubeClient client.Interface, stopchannel <-chan struct{}) v1batchlister.JobLister {
listWatcher := cache.NewListWatchFromClient(kubeClient.Batch().RESTClient(), "jobs", apiv1.NamespaceAll, fields.Everything())
listWatcher := cache.NewListWatchFromClient(kubeClient.BatchV1().RESTClient(), "jobs", apiv1.NamespaceAll, fields.Everything())
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
lister := v1batchlister.NewJobLister(store)
reflector := cache.NewReflector(listWatcher, &batchv1.Job{}, store, time.Hour)
Expand All @@ -343,7 +343,7 @@ func NewJobLister(kubeClient client.Interface, stopchannel <-chan struct{}) v1ba

// NewReplicaSetLister builds a replicaset lister.
func NewReplicaSetLister(kubeClient client.Interface, stopchannel <-chan struct{}) v1appslister.ReplicaSetLister {
listWatcher := cache.NewListWatchFromClient(kubeClient.Apps().RESTClient(), "replicasets", apiv1.NamespaceAll, fields.Everything())
listWatcher := cache.NewListWatchFromClient(kubeClient.AppsV1().RESTClient(), "replicasets", apiv1.NamespaceAll, fields.Everything())
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
lister := v1appslister.NewReplicaSetLister(store)
reflector := cache.NewReflector(listWatcher, &appsv1.ReplicaSet{}, store, time.Hour)
Expand All @@ -353,7 +353,7 @@ func NewReplicaSetLister(kubeClient client.Interface, stopchannel <-chan struct{

// NewStatefulSetLister builds a statefulset lister.
func NewStatefulSetLister(kubeClient client.Interface, stopchannel <-chan struct{}) v1appslister.StatefulSetLister {
listWatcher := cache.NewListWatchFromClient(kubeClient.Apps().RESTClient(), "statefulsets", apiv1.NamespaceAll, fields.Everything())
listWatcher := cache.NewListWatchFromClient(kubeClient.AppsV1().RESTClient(), "statefulsets", apiv1.NamespaceAll, fields.Everything())
store := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
lister := v1appslister.NewStatefulSetLister(store)
reflector := cache.NewReflector(listWatcher, &appsv1.StatefulSet{}, store, time.Hour)
Expand Down

0 comments on commit ea0d61f

Please sign in to comment.