mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-24 04:29:36 +00:00
run hack/update-codegen.sh
Kubernetes-commit: 6a4b80fcabc5e950af997d97f447354b83fcdcc4
This commit is contained in:
committed by
Kubernetes Publisher
parent
d017730688
commit
a6812b3f80
@@ -38,19 +38,33 @@ type ComponentStatusInformer interface {
|
||||
}
|
||||
|
||||
type componentStatusInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewComponentStatusInformer constructs a new informer for ComponentStatus type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredComponentStatusInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredComponentStatusInformer constructs a new informer for ComponentStatus type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CoreV1().ComponentStatuses().List(options)
|
||||
},
|
||||
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CoreV1().ComponentStatuses().Watch(options)
|
||||
},
|
||||
},
|
||||
@@ -60,12 +74,12 @@ func NewComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.D
|
||||
)
|
||||
}
|
||||
|
||||
func defaultComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewComponentStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
func (f *componentStatusInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredComponentStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *componentStatusInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&core_v1.ComponentStatus{}, defaultComponentStatusInformer)
|
||||
return f.factory.InformerFor(&core_v1.ComponentStatus{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *componentStatusInformer) Lister() v1.ComponentStatusLister {
|
||||
|
Reference in New Issue
Block a user