manual changes to let client-gen use versioned options

This commit is contained in:
Chao Xu
2016-09-02 11:57:44 -07:00
parent d26b4ca285
commit 75cc05de82
34 changed files with 401 additions and 317 deletions

View File

@@ -121,10 +121,12 @@ func NewReplicaSetController(federationClient fedclientset.Interface) *ReplicaSe
return cache.NewInformer(
&cache.ListWatch{
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
return clientset.Extensions().ReplicaSets(apiv1.NamespaceAll).List(options)
versionedOptions := fedutil.VersionizeV1ListOptions(options)
return clientset.Extensions().ReplicaSets(apiv1.NamespaceAll).List(versionedOptions)
},
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return clientset.Extensions().ReplicaSets(apiv1.NamespaceAll).Watch(options)
versionedOptions := fedutil.VersionizeV1ListOptions(options)
return clientset.Extensions().ReplicaSets(apiv1.NamespaceAll).Watch(versionedOptions)
},
},
&extensionsv1.ReplicaSet{},
@@ -148,10 +150,12 @@ func NewReplicaSetController(federationClient fedclientset.Interface) *ReplicaSe
return cache.NewInformer(
&cache.ListWatch{
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
return clientset.Core().Pods(apiv1.NamespaceAll).List(options)
versionedOptions := fedutil.VersionizeV1ListOptions(options)
return clientset.Core().Pods(apiv1.NamespaceAll).List(versionedOptions)
},
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return clientset.Core().Pods(apiv1.NamespaceAll).Watch(options)
versionedOptions := fedutil.VersionizeV1ListOptions(options)
return clientset.Core().Pods(apiv1.NamespaceAll).Watch(versionedOptions)
},
},
&apiv1.Pod{},
@@ -168,10 +172,12 @@ func NewReplicaSetController(federationClient fedclientset.Interface) *ReplicaSe
frsc.replicaSetStore.Store, frsc.replicaSetController = cache.NewInformer(
&cache.ListWatch{
ListFunc: func(options api.ListOptions) (runtime.Object, error) {
return frsc.fedClient.Extensions().ReplicaSets(apiv1.NamespaceAll).List(options)
versionedOptions := fedutil.VersionizeV1ListOptions(options)
return frsc.fedClient.Extensions().ReplicaSets(apiv1.NamespaceAll).List(versionedOptions)
},
WatchFunc: func(options api.ListOptions) (watch.Interface, error) {
return frsc.fedClient.Extensions().ReplicaSets(apiv1.NamespaceAll).Watch(options)
versionedOptions := fedutil.VersionizeV1ListOptions(options)
return frsc.fedClient.Extensions().ReplicaSets(apiv1.NamespaceAll).Watch(versionedOptions)
},
},
&extensionsv1.ReplicaSet{},
@@ -194,7 +200,7 @@ func NewReplicaSetController(federationClient fedclientset.Interface) *ReplicaSe
},
func(client kubeclientset.Interface, obj runtime.Object) error {
rs := obj.(*extensionsv1.ReplicaSet)
err := client.Extensions().ReplicaSets(rs.Namespace).Delete(rs.Name, &api.DeleteOptions{})
err := client.Extensions().ReplicaSets(rs.Namespace).Delete(rs.Name, &apiv1.DeleteOptions{})
return err
})