refactor: move ListOptions references to metav1

This commit is contained in:
Clayton Coleman
2017-01-21 22:36:02 -05:00
parent 245b592fac
commit 469df12038
364 changed files with 1519 additions and 1554 deletions

View File

@@ -26,6 +26,7 @@ import (
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
pkgruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/runtime"
@@ -122,11 +123,11 @@ func New(cloud cloudprovider.Interface, kubeClient clientset.Interface, clusterN
}
s.serviceStore.Indexer, s.serviceController = cache.NewIndexerInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (pkgruntime.Object, error) {
return s.kubeClient.Core().Services(v1.NamespaceAll).List(options)
ListFunc: func(options metav1.ListOptions) (pkgruntime.Object, error) {
return s.kubeClient.Core().Services(metav1.NamespaceAll).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return s.kubeClient.Core().Services(v1.NamespaceAll).Watch(options)
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
return s.kubeClient.Core().Services(metav1.NamespaceAll).Watch(options)
},
},
&v1.Service{},
@@ -176,7 +177,7 @@ func (s *ServiceController) Run(workers int) {
for i := 0; i < workers; i++ {
go wait.Until(s.worker, time.Second, wait.NeverStop)
}
nodeLW := cache.NewListWatchFromClient(s.kubeClient.Core().RESTClient(), "nodes", v1.NamespaceAll, fields.Everything())
nodeLW := cache.NewListWatchFromClient(s.kubeClient.Core().RESTClient(), "nodes", metav1.NamespaceAll, fields.Everything())
cache.NewReflector(nodeLW, &v1.Node{}, s.nodeLister.Store, 0).Run()
go wait.Until(s.nodeSyncLoop, nodeSyncPeriod, wait.NeverStop)
}