Re-generate informers
This commit is contained in:
@@ -41,8 +41,11 @@ type externalAdmissionHookConfigurationInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newExternalAdmissionHookConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewExternalAdmissionHookConfigurationInformer constructs a new informer for ExternalAdmissionHookConfiguration 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 NewExternalAdmissionHookConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Admissionregistration().ExternalAdmissionHookConfigurations().List(options)
|
||||
@@ -53,14 +56,16 @@ func newExternalAdmissionHookConfigurationInformer(client internalclientset.Inte
|
||||
},
|
||||
&admissionregistration.ExternalAdmissionHookConfiguration{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultExternalAdmissionHookConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewExternalAdmissionHookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *externalAdmissionHookConfigurationInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&admissionregistration.ExternalAdmissionHookConfiguration{}, newExternalAdmissionHookConfigurationInformer)
|
||||
return f.factory.InformerFor(&admissionregistration.ExternalAdmissionHookConfiguration{}, defaultExternalAdmissionHookConfigurationInformer)
|
||||
}
|
||||
|
||||
func (f *externalAdmissionHookConfigurationInformer) Lister() internalversion.ExternalAdmissionHookConfigurationLister {
|
||||
|
@@ -41,8 +41,11 @@ type initializerConfigurationInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newInitializerConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewInitializerConfigurationInformer constructs a new informer for InitializerConfiguration 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 NewInitializerConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Admissionregistration().InitializerConfigurations().List(options)
|
||||
@@ -53,14 +56,16 @@ func newInitializerConfigurationInformer(client internalclientset.Interface, res
|
||||
},
|
||||
&admissionregistration.InitializerConfiguration{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultInitializerConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewInitializerConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *initializerConfigurationInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&admissionregistration.InitializerConfiguration{}, newInitializerConfigurationInformer)
|
||||
return f.factory.InformerFor(&admissionregistration.InitializerConfiguration{}, defaultInitializerConfigurationInformer)
|
||||
}
|
||||
|
||||
func (f *initializerConfigurationInformer) Lister() internalversion.InitializerConfigurationLister {
|
||||
|
@@ -41,26 +41,31 @@ type controllerRevisionInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newControllerRevisionInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewControllerRevisionInformer constructs a new informer for ControllerRevision 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 NewControllerRevisionInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Apps().ControllerRevisions(v1.NamespaceAll).List(options)
|
||||
return client.Apps().ControllerRevisions(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Apps().ControllerRevisions(v1.NamespaceAll).Watch(options)
|
||||
return client.Apps().ControllerRevisions(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&apps.ControllerRevision{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultControllerRevisionInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewControllerRevisionInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *controllerRevisionInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apps.ControllerRevision{}, newControllerRevisionInformer)
|
||||
return f.factory.InformerFor(&apps.ControllerRevision{}, defaultControllerRevisionInformer)
|
||||
}
|
||||
|
||||
func (f *controllerRevisionInformer) Lister() internalversion.ControllerRevisionLister {
|
||||
|
@@ -41,26 +41,31 @@ type statefulSetInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newStatefulSetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewStatefulSetInformer constructs a new informer for StatefulSet 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 NewStatefulSetInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Apps().StatefulSets(v1.NamespaceAll).List(options)
|
||||
return client.Apps().StatefulSets(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Apps().StatefulSets(v1.NamespaceAll).Watch(options)
|
||||
return client.Apps().StatefulSets(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&apps.StatefulSet{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultStatefulSetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewStatefulSetInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *statefulSetInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apps.StatefulSet{}, newStatefulSetInformer)
|
||||
return f.factory.InformerFor(&apps.StatefulSet{}, defaultStatefulSetInformer)
|
||||
}
|
||||
|
||||
func (f *statefulSetInformer) Lister() internalversion.StatefulSetLister {
|
||||
|
@@ -41,26 +41,31 @@ type horizontalPodAutoscalerInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newHorizontalPodAutoscalerInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewHorizontalPodAutoscalerInformer constructs a new informer for HorizontalPodAutoscaler 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 NewHorizontalPodAutoscalerInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Autoscaling().HorizontalPodAutoscalers(v1.NamespaceAll).List(options)
|
||||
return client.Autoscaling().HorizontalPodAutoscalers(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Autoscaling().HorizontalPodAutoscalers(v1.NamespaceAll).Watch(options)
|
||||
return client.Autoscaling().HorizontalPodAutoscalers(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&autoscaling.HorizontalPodAutoscaler{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultHorizontalPodAutoscalerInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewHorizontalPodAutoscalerInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&autoscaling.HorizontalPodAutoscaler{}, newHorizontalPodAutoscalerInformer)
|
||||
return f.factory.InformerFor(&autoscaling.HorizontalPodAutoscaler{}, defaultHorizontalPodAutoscalerInformer)
|
||||
}
|
||||
|
||||
func (f *horizontalPodAutoscalerInformer) Lister() internalversion.HorizontalPodAutoscalerLister {
|
||||
|
@@ -41,26 +41,31 @@ type cronJobInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newCronJobInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewCronJobInformer constructs a new informer for CronJob 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 NewCronJobInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Batch().CronJobs(v1.NamespaceAll).List(options)
|
||||
return client.Batch().CronJobs(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Batch().CronJobs(v1.NamespaceAll).Watch(options)
|
||||
return client.Batch().CronJobs(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&batch.CronJob{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultCronJobInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewCronJobInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *cronJobInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&batch.CronJob{}, newCronJobInformer)
|
||||
return f.factory.InformerFor(&batch.CronJob{}, defaultCronJobInformer)
|
||||
}
|
||||
|
||||
func (f *cronJobInformer) Lister() internalversion.CronJobLister {
|
||||
|
@@ -41,26 +41,31 @@ type jobInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newJobInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewJobInformer constructs a new informer for Job 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 NewJobInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Batch().Jobs(v1.NamespaceAll).List(options)
|
||||
return client.Batch().Jobs(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Batch().Jobs(v1.NamespaceAll).Watch(options)
|
||||
return client.Batch().Jobs(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&batch.Job{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultJobInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewJobInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *jobInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&batch.Job{}, newJobInformer)
|
||||
return f.factory.InformerFor(&batch.Job{}, defaultJobInformer)
|
||||
}
|
||||
|
||||
func (f *jobInformer) Lister() internalversion.JobLister {
|
||||
|
@@ -41,8 +41,11 @@ type certificateSigningRequestInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newCertificateSigningRequestInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest 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 NewCertificateSigningRequestInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Certificates().CertificateSigningRequests().List(options)
|
||||
@@ -53,14 +56,16 @@ func newCertificateSigningRequestInformer(client internalclientset.Interface, re
|
||||
},
|
||||
&certificates.CertificateSigningRequest{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultCertificateSigningRequestInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewCertificateSigningRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&certificates.CertificateSigningRequest{}, newCertificateSigningRequestInformer)
|
||||
return f.factory.InformerFor(&certificates.CertificateSigningRequest{}, defaultCertificateSigningRequestInformer)
|
||||
}
|
||||
|
||||
func (f *certificateSigningRequestInformer) Lister() internalversion.CertificateSigningRequestLister {
|
||||
|
@@ -41,8 +41,11 @@ type componentStatusInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newComponentStatusInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// 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 internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().ComponentStatuses().List(options)
|
||||
@@ -53,14 +56,16 @@ func newComponentStatusInformer(client internalclientset.Interface, resyncPeriod
|
||||
},
|
||||
&api.ComponentStatus{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultComponentStatusInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewComponentStatusInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *componentStatusInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.ComponentStatus{}, newComponentStatusInformer)
|
||||
return f.factory.InformerFor(&api.ComponentStatus{}, defaultComponentStatusInformer)
|
||||
}
|
||||
|
||||
func (f *componentStatusInformer) Lister() internalversion.ComponentStatusLister {
|
||||
|
@@ -41,26 +41,31 @@ type configMapInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newConfigMapInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewConfigMapInformer constructs a new informer for ConfigMap 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 NewConfigMapInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().ConfigMaps(v1.NamespaceAll).List(options)
|
||||
return client.Core().ConfigMaps(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().ConfigMaps(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().ConfigMaps(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.ConfigMap{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultConfigMapInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewConfigMapInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *configMapInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.ConfigMap{}, newConfigMapInformer)
|
||||
return f.factory.InformerFor(&api.ConfigMap{}, defaultConfigMapInformer)
|
||||
}
|
||||
|
||||
func (f *configMapInformer) Lister() internalversion.ConfigMapLister {
|
||||
|
@@ -41,26 +41,31 @@ type endpointsInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newEndpointsInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewEndpointsInformer constructs a new informer for Endpoints 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 NewEndpointsInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Endpoints(v1.NamespaceAll).List(options)
|
||||
return client.Core().Endpoints(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().Endpoints(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().Endpoints(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Endpoints{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultEndpointsInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewEndpointsInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *endpointsInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Endpoints{}, newEndpointsInformer)
|
||||
return f.factory.InformerFor(&api.Endpoints{}, defaultEndpointsInformer)
|
||||
}
|
||||
|
||||
func (f *endpointsInformer) Lister() internalversion.EndpointsLister {
|
||||
|
@@ -41,26 +41,31 @@ type eventInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newEventInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewEventInformer constructs a new informer for Event 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 NewEventInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Events(v1.NamespaceAll).List(options)
|
||||
return client.Core().Events(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().Events(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().Events(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Event{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultEventInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewEventInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *eventInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Event{}, newEventInformer)
|
||||
return f.factory.InformerFor(&api.Event{}, defaultEventInformer)
|
||||
}
|
||||
|
||||
func (f *eventInformer) Lister() internalversion.EventLister {
|
||||
|
@@ -41,26 +41,31 @@ type limitRangeInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newLimitRangeInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewLimitRangeInformer constructs a new informer for LimitRange 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 NewLimitRangeInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().LimitRanges(v1.NamespaceAll).List(options)
|
||||
return client.Core().LimitRanges(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().LimitRanges(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().LimitRanges(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.LimitRange{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultLimitRangeInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewLimitRangeInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *limitRangeInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.LimitRange{}, newLimitRangeInformer)
|
||||
return f.factory.InformerFor(&api.LimitRange{}, defaultLimitRangeInformer)
|
||||
}
|
||||
|
||||
func (f *limitRangeInformer) Lister() internalversion.LimitRangeLister {
|
||||
|
@@ -41,8 +41,11 @@ type namespaceInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newNamespaceInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewNamespaceInformer constructs a new informer for Namespace 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 NewNamespaceInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Namespaces().List(options)
|
||||
@@ -53,14 +56,16 @@ func newNamespaceInformer(client internalclientset.Interface, resyncPeriod time.
|
||||
},
|
||||
&api.Namespace{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultNamespaceInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewNamespaceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *namespaceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Namespace{}, newNamespaceInformer)
|
||||
return f.factory.InformerFor(&api.Namespace{}, defaultNamespaceInformer)
|
||||
}
|
||||
|
||||
func (f *namespaceInformer) Lister() internalversion.NamespaceLister {
|
||||
|
@@ -41,8 +41,11 @@ type nodeInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newNodeInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewNodeInformer constructs a new informer for Node 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 NewNodeInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Nodes().List(options)
|
||||
@@ -53,14 +56,16 @@ func newNodeInformer(client internalclientset.Interface, resyncPeriod time.Durat
|
||||
},
|
||||
&api.Node{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultNodeInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewNodeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *nodeInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Node{}, newNodeInformer)
|
||||
return f.factory.InformerFor(&api.Node{}, defaultNodeInformer)
|
||||
}
|
||||
|
||||
func (f *nodeInformer) Lister() internalversion.NodeLister {
|
||||
|
@@ -41,8 +41,11 @@ type persistentVolumeInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPersistentVolumeInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPersistentVolumeInformer constructs a new informer for PersistentVolume 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 NewPersistentVolumeInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().PersistentVolumes().List(options)
|
||||
@@ -53,14 +56,16 @@ func newPersistentVolumeInformer(client internalclientset.Interface, resyncPerio
|
||||
},
|
||||
&api.PersistentVolume{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPersistentVolumeInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPersistentVolumeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *persistentVolumeInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.PersistentVolume{}, newPersistentVolumeInformer)
|
||||
return f.factory.InformerFor(&api.PersistentVolume{}, defaultPersistentVolumeInformer)
|
||||
}
|
||||
|
||||
func (f *persistentVolumeInformer) Lister() internalversion.PersistentVolumeLister {
|
||||
|
@@ -41,26 +41,31 @@ type persistentVolumeClaimInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPersistentVolumeClaimInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPersistentVolumeClaimInformer constructs a new informer for PersistentVolumeClaim 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 NewPersistentVolumeClaimInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().PersistentVolumeClaims(v1.NamespaceAll).List(options)
|
||||
return client.Core().PersistentVolumeClaims(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().PersistentVolumeClaims(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().PersistentVolumeClaims(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.PersistentVolumeClaim{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPersistentVolumeClaimInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPersistentVolumeClaimInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *persistentVolumeClaimInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.PersistentVolumeClaim{}, newPersistentVolumeClaimInformer)
|
||||
return f.factory.InformerFor(&api.PersistentVolumeClaim{}, defaultPersistentVolumeClaimInformer)
|
||||
}
|
||||
|
||||
func (f *persistentVolumeClaimInformer) Lister() internalversion.PersistentVolumeClaimLister {
|
||||
|
@@ -41,26 +41,31 @@ type podInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPodInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPodInformer constructs a new informer for Pod 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 NewPodInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Pods(v1.NamespaceAll).List(options)
|
||||
return client.Core().Pods(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().Pods(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().Pods(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Pod{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPodInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPodInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *podInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Pod{}, newPodInformer)
|
||||
return f.factory.InformerFor(&api.Pod{}, defaultPodInformer)
|
||||
}
|
||||
|
||||
func (f *podInformer) Lister() internalversion.PodLister {
|
||||
|
@@ -41,26 +41,31 @@ type podTemplateInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPodTemplateInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPodTemplateInformer constructs a new informer for PodTemplate 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 NewPodTemplateInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().PodTemplates(v1.NamespaceAll).List(options)
|
||||
return client.Core().PodTemplates(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().PodTemplates(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().PodTemplates(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.PodTemplate{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPodTemplateInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPodTemplateInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *podTemplateInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.PodTemplate{}, newPodTemplateInformer)
|
||||
return f.factory.InformerFor(&api.PodTemplate{}, defaultPodTemplateInformer)
|
||||
}
|
||||
|
||||
func (f *podTemplateInformer) Lister() internalversion.PodTemplateLister {
|
||||
|
@@ -41,26 +41,31 @@ type replicationControllerInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newReplicationControllerInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewReplicationControllerInformer constructs a new informer for ReplicationController 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 NewReplicationControllerInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().ReplicationControllers(v1.NamespaceAll).List(options)
|
||||
return client.Core().ReplicationControllers(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().ReplicationControllers(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().ReplicationControllers(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.ReplicationController{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultReplicationControllerInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewReplicationControllerInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *replicationControllerInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.ReplicationController{}, newReplicationControllerInformer)
|
||||
return f.factory.InformerFor(&api.ReplicationController{}, defaultReplicationControllerInformer)
|
||||
}
|
||||
|
||||
func (f *replicationControllerInformer) Lister() internalversion.ReplicationControllerLister {
|
||||
|
@@ -41,26 +41,31 @@ type resourceQuotaInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newResourceQuotaInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewResourceQuotaInformer constructs a new informer for ResourceQuota 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 NewResourceQuotaInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().ResourceQuotas(v1.NamespaceAll).List(options)
|
||||
return client.Core().ResourceQuotas(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().ResourceQuotas(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().ResourceQuotas(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.ResourceQuota{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultResourceQuotaInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewResourceQuotaInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *resourceQuotaInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.ResourceQuota{}, newResourceQuotaInformer)
|
||||
return f.factory.InformerFor(&api.ResourceQuota{}, defaultResourceQuotaInformer)
|
||||
}
|
||||
|
||||
func (f *resourceQuotaInformer) Lister() internalversion.ResourceQuotaLister {
|
||||
|
@@ -41,26 +41,31 @@ type secretInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newSecretInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewSecretInformer constructs a new informer for Secret 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 NewSecretInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Secrets(v1.NamespaceAll).List(options)
|
||||
return client.Core().Secrets(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().Secrets(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().Secrets(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Secret{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultSecretInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewSecretInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *secretInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Secret{}, newSecretInformer)
|
||||
return f.factory.InformerFor(&api.Secret{}, defaultSecretInformer)
|
||||
}
|
||||
|
||||
func (f *secretInformer) Lister() internalversion.SecretLister {
|
||||
|
@@ -41,26 +41,31 @@ type serviceInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newServiceInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewServiceInformer constructs a new informer for Service 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 NewServiceInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().Services(v1.NamespaceAll).List(options)
|
||||
return client.Core().Services(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().Services(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().Services(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.Service{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultServiceInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewServiceInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *serviceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.Service{}, newServiceInformer)
|
||||
return f.factory.InformerFor(&api.Service{}, defaultServiceInformer)
|
||||
}
|
||||
|
||||
func (f *serviceInformer) Lister() internalversion.ServiceLister {
|
||||
|
@@ -41,26 +41,31 @@ type serviceAccountInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newServiceAccountInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewServiceAccountInformer constructs a new informer for ServiceAccount 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 NewServiceAccountInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Core().ServiceAccounts(v1.NamespaceAll).List(options)
|
||||
return client.Core().ServiceAccounts(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Core().ServiceAccounts(v1.NamespaceAll).Watch(options)
|
||||
return client.Core().ServiceAccounts(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&api.ServiceAccount{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultServiceAccountInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewServiceAccountInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *serviceAccountInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&api.ServiceAccount{}, newServiceAccountInformer)
|
||||
return f.factory.InformerFor(&api.ServiceAccount{}, defaultServiceAccountInformer)
|
||||
}
|
||||
|
||||
func (f *serviceAccountInformer) Lister() internalversion.ServiceAccountLister {
|
||||
|
@@ -41,26 +41,31 @@ type daemonSetInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newDaemonSetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewDaemonSetInformer constructs a new informer for DaemonSet 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 NewDaemonSetInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().DaemonSets(v1.NamespaceAll).List(options)
|
||||
return client.Extensions().DaemonSets(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Extensions().DaemonSets(v1.NamespaceAll).Watch(options)
|
||||
return client.Extensions().DaemonSets(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&extensions.DaemonSet{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultDaemonSetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewDaemonSetInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *daemonSetInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.DaemonSet{}, newDaemonSetInformer)
|
||||
return f.factory.InformerFor(&extensions.DaemonSet{}, defaultDaemonSetInformer)
|
||||
}
|
||||
|
||||
func (f *daemonSetInformer) Lister() internalversion.DaemonSetLister {
|
||||
|
@@ -41,26 +41,31 @@ type deploymentInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newDeploymentInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewDeploymentInformer constructs a new informer for Deployment 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 NewDeploymentInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().Deployments(v1.NamespaceAll).List(options)
|
||||
return client.Extensions().Deployments(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Extensions().Deployments(v1.NamespaceAll).Watch(options)
|
||||
return client.Extensions().Deployments(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&extensions.Deployment{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultDeploymentInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewDeploymentInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *deploymentInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.Deployment{}, newDeploymentInformer)
|
||||
return f.factory.InformerFor(&extensions.Deployment{}, defaultDeploymentInformer)
|
||||
}
|
||||
|
||||
func (f *deploymentInformer) Lister() internalversion.DeploymentLister {
|
||||
|
@@ -41,26 +41,31 @@ type ingressInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newIngressInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewIngressInformer constructs a new informer for Ingress 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 NewIngressInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().Ingresses(v1.NamespaceAll).List(options)
|
||||
return client.Extensions().Ingresses(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Extensions().Ingresses(v1.NamespaceAll).Watch(options)
|
||||
return client.Extensions().Ingresses(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&extensions.Ingress{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultIngressInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewIngressInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *ingressInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.Ingress{}, newIngressInformer)
|
||||
return f.factory.InformerFor(&extensions.Ingress{}, defaultIngressInformer)
|
||||
}
|
||||
|
||||
func (f *ingressInformer) Lister() internalversion.IngressLister {
|
||||
|
@@ -41,26 +41,31 @@ type networkPolicyInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newNetworkPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewNetworkPolicyInformer constructs a new informer for NetworkPolicy 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 NewNetworkPolicyInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().NetworkPolicies(v1.NamespaceAll).List(options)
|
||||
return client.Extensions().NetworkPolicies(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Extensions().NetworkPolicies(v1.NamespaceAll).Watch(options)
|
||||
return client.Extensions().NetworkPolicies(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&extensions.NetworkPolicy{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultNetworkPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewNetworkPolicyInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.NetworkPolicy{}, newNetworkPolicyInformer)
|
||||
return f.factory.InformerFor(&extensions.NetworkPolicy{}, defaultNetworkPolicyInformer)
|
||||
}
|
||||
|
||||
func (f *networkPolicyInformer) Lister() internalversion.NetworkPolicyLister {
|
||||
|
@@ -41,8 +41,11 @@ type podSecurityPolicyInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPodSecurityPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPodSecurityPolicyInformer constructs a new informer for PodSecurityPolicy 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 NewPodSecurityPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().PodSecurityPolicies().List(options)
|
||||
@@ -53,14 +56,16 @@ func newPodSecurityPolicyInformer(client internalclientset.Interface, resyncPeri
|
||||
},
|
||||
&extensions.PodSecurityPolicy{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPodSecurityPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPodSecurityPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *podSecurityPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.PodSecurityPolicy{}, newPodSecurityPolicyInformer)
|
||||
return f.factory.InformerFor(&extensions.PodSecurityPolicy{}, defaultPodSecurityPolicyInformer)
|
||||
}
|
||||
|
||||
func (f *podSecurityPolicyInformer) Lister() internalversion.PodSecurityPolicyLister {
|
||||
|
@@ -41,26 +41,31 @@ type replicaSetInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newReplicaSetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewReplicaSetInformer constructs a new informer for ReplicaSet 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 NewReplicaSetInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().ReplicaSets(v1.NamespaceAll).List(options)
|
||||
return client.Extensions().ReplicaSets(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Extensions().ReplicaSets(v1.NamespaceAll).Watch(options)
|
||||
return client.Extensions().ReplicaSets(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&extensions.ReplicaSet{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultReplicaSetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewReplicaSetInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *replicaSetInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.ReplicaSet{}, newReplicaSetInformer)
|
||||
return f.factory.InformerFor(&extensions.ReplicaSet{}, defaultReplicaSetInformer)
|
||||
}
|
||||
|
||||
func (f *replicaSetInformer) Lister() internalversion.ReplicaSetLister {
|
||||
|
@@ -41,8 +41,11 @@ type thirdPartyResourceInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newThirdPartyResourceInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewThirdPartyResourceInformer constructs a new informer for ThirdPartyResource 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 NewThirdPartyResourceInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Extensions().ThirdPartyResources().List(options)
|
||||
@@ -53,14 +56,16 @@ func newThirdPartyResourceInformer(client internalclientset.Interface, resyncPer
|
||||
},
|
||||
&extensions.ThirdPartyResource{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultThirdPartyResourceInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewThirdPartyResourceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *thirdPartyResourceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&extensions.ThirdPartyResource{}, newThirdPartyResourceInformer)
|
||||
return f.factory.InformerFor(&extensions.ThirdPartyResource{}, defaultThirdPartyResourceInformer)
|
||||
}
|
||||
|
||||
func (f *thirdPartyResourceInformer) Lister() internalversion.ThirdPartyResourceLister {
|
||||
|
@@ -41,26 +41,31 @@ type networkPolicyInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newNetworkPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewNetworkPolicyInformer constructs a new informer for NetworkPolicy 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 NewNetworkPolicyInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Networking().NetworkPolicies(v1.NamespaceAll).List(options)
|
||||
return client.Networking().NetworkPolicies(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Networking().NetworkPolicies(v1.NamespaceAll).Watch(options)
|
||||
return client.Networking().NetworkPolicies(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&networking.NetworkPolicy{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultNetworkPolicyInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewNetworkPolicyInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&networking.NetworkPolicy{}, newNetworkPolicyInformer)
|
||||
return f.factory.InformerFor(&networking.NetworkPolicy{}, defaultNetworkPolicyInformer)
|
||||
}
|
||||
|
||||
func (f *networkPolicyInformer) Lister() internalversion.NetworkPolicyLister {
|
||||
|
@@ -41,26 +41,31 @@ type podDisruptionBudgetInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPodDisruptionBudgetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPodDisruptionBudgetInformer constructs a new informer for PodDisruptionBudget 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 NewPodDisruptionBudgetInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Policy().PodDisruptionBudgets(v1.NamespaceAll).List(options)
|
||||
return client.Policy().PodDisruptionBudgets(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Policy().PodDisruptionBudgets(v1.NamespaceAll).Watch(options)
|
||||
return client.Policy().PodDisruptionBudgets(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&policy.PodDisruptionBudget{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPodDisruptionBudgetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPodDisruptionBudgetInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *podDisruptionBudgetInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&policy.PodDisruptionBudget{}, newPodDisruptionBudgetInformer)
|
||||
return f.factory.InformerFor(&policy.PodDisruptionBudget{}, defaultPodDisruptionBudgetInformer)
|
||||
}
|
||||
|
||||
func (f *podDisruptionBudgetInformer) Lister() internalversion.PodDisruptionBudgetLister {
|
||||
|
@@ -41,8 +41,11 @@ type clusterRoleInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newClusterRoleInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewClusterRoleInformer constructs a new informer for ClusterRole 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 NewClusterRoleInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Rbac().ClusterRoles().List(options)
|
||||
@@ -53,14 +56,16 @@ func newClusterRoleInformer(client internalclientset.Interface, resyncPeriod tim
|
||||
},
|
||||
&rbac.ClusterRole{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultClusterRoleInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewClusterRoleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *clusterRoleInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&rbac.ClusterRole{}, newClusterRoleInformer)
|
||||
return f.factory.InformerFor(&rbac.ClusterRole{}, defaultClusterRoleInformer)
|
||||
}
|
||||
|
||||
func (f *clusterRoleInformer) Lister() internalversion.ClusterRoleLister {
|
||||
|
@@ -41,8 +41,11 @@ type clusterRoleBindingInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newClusterRoleBindingInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewClusterRoleBindingInformer constructs a new informer for ClusterRoleBinding 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 NewClusterRoleBindingInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Rbac().ClusterRoleBindings().List(options)
|
||||
@@ -53,14 +56,16 @@ func newClusterRoleBindingInformer(client internalclientset.Interface, resyncPer
|
||||
},
|
||||
&rbac.ClusterRoleBinding{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultClusterRoleBindingInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewClusterRoleBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *clusterRoleBindingInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&rbac.ClusterRoleBinding{}, newClusterRoleBindingInformer)
|
||||
return f.factory.InformerFor(&rbac.ClusterRoleBinding{}, defaultClusterRoleBindingInformer)
|
||||
}
|
||||
|
||||
func (f *clusterRoleBindingInformer) Lister() internalversion.ClusterRoleBindingLister {
|
||||
|
@@ -41,26 +41,31 @@ type roleInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newRoleInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewRoleInformer constructs a new informer for Role 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 NewRoleInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Rbac().Roles(v1.NamespaceAll).List(options)
|
||||
return client.Rbac().Roles(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Rbac().Roles(v1.NamespaceAll).Watch(options)
|
||||
return client.Rbac().Roles(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&rbac.Role{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultRoleInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewRoleInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *roleInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&rbac.Role{}, newRoleInformer)
|
||||
return f.factory.InformerFor(&rbac.Role{}, defaultRoleInformer)
|
||||
}
|
||||
|
||||
func (f *roleInformer) Lister() internalversion.RoleLister {
|
||||
|
@@ -41,26 +41,31 @@ type roleBindingInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newRoleBindingInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewRoleBindingInformer constructs a new informer for RoleBinding 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 NewRoleBindingInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Rbac().RoleBindings(v1.NamespaceAll).List(options)
|
||||
return client.Rbac().RoleBindings(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Rbac().RoleBindings(v1.NamespaceAll).Watch(options)
|
||||
return client.Rbac().RoleBindings(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&rbac.RoleBinding{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultRoleBindingInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewRoleBindingInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *roleBindingInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&rbac.RoleBinding{}, newRoleBindingInformer)
|
||||
return f.factory.InformerFor(&rbac.RoleBinding{}, defaultRoleBindingInformer)
|
||||
}
|
||||
|
||||
func (f *roleBindingInformer) Lister() internalversion.RoleBindingLister {
|
||||
|
@@ -41,8 +41,11 @@ type priorityClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPriorityClassInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPriorityClassInformer constructs a new informer for PriorityClass 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 NewPriorityClassInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Scheduling().PriorityClasses().List(options)
|
||||
@@ -53,14 +56,16 @@ func newPriorityClassInformer(client internalclientset.Interface, resyncPeriod t
|
||||
},
|
||||
&scheduling.PriorityClass{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPriorityClassInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPriorityClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&scheduling.PriorityClass{}, newPriorityClassInformer)
|
||||
return f.factory.InformerFor(&scheduling.PriorityClass{}, defaultPriorityClassInformer)
|
||||
}
|
||||
|
||||
func (f *priorityClassInformer) Lister() internalversion.PriorityClassLister {
|
||||
|
@@ -41,26 +41,31 @@ type podPresetInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newPodPresetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewPodPresetInformer constructs a new informer for PodPreset 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 NewPodPresetInformer(client internalclientset.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Settings().PodPresets(v1.NamespaceAll).List(options)
|
||||
return client.Settings().PodPresets(namespace).List(options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
return client.Settings().PodPresets(v1.NamespaceAll).Watch(options)
|
||||
return client.Settings().PodPresets(namespace).Watch(options)
|
||||
},
|
||||
},
|
||||
&settings.PodPreset{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultPodPresetInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewPodPresetInformer(client, v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *podPresetInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&settings.PodPreset{}, newPodPresetInformer)
|
||||
return f.factory.InformerFor(&settings.PodPreset{}, defaultPodPresetInformer)
|
||||
}
|
||||
|
||||
func (f *podPresetInformer) Lister() internalversion.PodPresetLister {
|
||||
|
@@ -41,8 +41,11 @@ type storageClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
}
|
||||
|
||||
func newStorageClassInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
sharedIndexInformer := cache.NewSharedIndexInformer(
|
||||
// NewStorageClassInformer constructs a new informer for StorageClass 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 NewStorageClassInformer(client internalclientset.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
return client.Storage().StorageClasses().List(options)
|
||||
@@ -53,14 +56,16 @@ func newStorageClassInformer(client internalclientset.Interface, resyncPeriod ti
|
||||
},
|
||||
&storage.StorageClass{},
|
||||
resyncPeriod,
|
||||
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
return sharedIndexInformer
|
||||
func defaultStorageClassInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewStorageClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
|
||||
}
|
||||
|
||||
func (f *storageClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&storage.StorageClass{}, newStorageClassInformer)
|
||||
return f.factory.InformerFor(&storage.StorageClass{}, defaultStorageClassInformer)
|
||||
}
|
||||
|
||||
func (f *storageClassInformer) Lister() internalversion.StorageClassLister {
|
||||
|
Reference in New Issue
Block a user