mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
fix rbac informer. it's listers are all internal
This commit is contained in:
@@ -19,6 +19,7 @@ package informers
|
|||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/pkg/api"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
rbac "k8s.io/kubernetes/pkg/apis/rbac"
|
||||||
"k8s.io/kubernetes/pkg/client/cache"
|
"k8s.io/kubernetes/pkg/client/cache"
|
||||||
@@ -47,10 +48,10 @@ func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer {
|
|||||||
informer = cache.NewSharedIndexInformer(
|
informer = cache.NewSharedIndexInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||||
return f.client.Rbac().ClusterRoles().List(options)
|
return f.internalclient.Rbac().ClusterRoles().List(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
return f.client.Rbac().ClusterRoles().Watch(options)
|
return f.internalclient.Rbac().ClusterRoles().Watch(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&rbac.ClusterRole{},
|
&rbac.ClusterRole{},
|
||||||
@@ -87,10 +88,10 @@ func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer {
|
|||||||
informer = cache.NewSharedIndexInformer(
|
informer = cache.NewSharedIndexInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||||
return f.client.Rbac().ClusterRoleBindings().List(options)
|
return f.internalclient.Rbac().ClusterRoleBindings().List(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
return f.client.Rbac().ClusterRoleBindings().Watch(options)
|
return f.internalclient.Rbac().ClusterRoleBindings().Watch(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&rbac.ClusterRoleBinding{},
|
&rbac.ClusterRoleBinding{},
|
||||||
@@ -127,10 +128,10 @@ func (f *roleInformer) Informer() cache.SharedIndexInformer {
|
|||||||
informer = cache.NewSharedIndexInformer(
|
informer = cache.NewSharedIndexInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||||
return f.client.Rbac().Roles(v1.NamespaceAll).List(options)
|
return f.internalclient.Rbac().Roles(v1.NamespaceAll).List(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
return f.client.Rbac().Roles(v1.NamespaceAll).Watch(options)
|
return f.internalclient.Rbac().Roles(v1.NamespaceAll).Watch(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&rbac.Role{},
|
&rbac.Role{},
|
||||||
@@ -167,10 +168,10 @@ func (f *roleBindingInformer) Informer() cache.SharedIndexInformer {
|
|||||||
informer = cache.NewSharedIndexInformer(
|
informer = cache.NewSharedIndexInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||||
return f.client.Rbac().RoleBindings(v1.NamespaceAll).List(options)
|
return f.internalclient.Rbac().RoleBindings(v1.NamespaceAll).List(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
return f.client.Rbac().RoleBindings(v1.NamespaceAll).Watch(options)
|
return f.internalclient.Rbac().RoleBindings(v1.NamespaceAll).Watch(convertListOptionsOrDie(options))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&rbac.RoleBinding{},
|
&rbac.RoleBinding{},
|
||||||
@@ -185,3 +186,11 @@ func (f *roleBindingInformer) Informer() cache.SharedIndexInformer {
|
|||||||
func (f *roleBindingInformer) Lister() cache.RoleBindingLister {
|
func (f *roleBindingInformer) Lister() cache.RoleBindingLister {
|
||||||
return cache.NewRoleBindingLister(f.Informer().GetIndexer())
|
return cache.NewRoleBindingLister(f.Informer().GetIndexer())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func convertListOptionsOrDie(in v1.ListOptions) api.ListOptions {
|
||||||
|
out := api.ListOptions{}
|
||||||
|
if err := api.Scheme.Convert(&in, &out, nil); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user