Re-generate informers

Kubernetes-commit: 37f909a274df25e2574cbc6a92f7a9991d1948ce
This commit is contained in:
Mikhail Mazurskiy 2017-07-25 12:19:17 +10:00 committed by Kubernetes Publisher
parent a2643f9d58
commit 953296ece8
48 changed files with 544 additions and 304 deletions

View File

@ -41,8 +41,11 @@ type externalAdmissionHookConfigurationInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newExternalAdmissionHookConfigurationInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.AdmissionregistrationV1alpha1().ExternalAdmissionHookConfigurations().List(options)
@ -53,14 +56,16 @@ func newExternalAdmissionHookConfigurationInformer(client kubernetes.Interface,
},
&admissionregistration_v1alpha1.ExternalAdmissionHookConfiguration{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultExternalAdmissionHookConfigurationInformer(client kubernetes.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_v1alpha1.ExternalAdmissionHookConfiguration{}, newExternalAdmissionHookConfigurationInformer)
return f.factory.InformerFor(&admissionregistration_v1alpha1.ExternalAdmissionHookConfiguration{}, defaultExternalAdmissionHookConfigurationInformer)
}
func (f *externalAdmissionHookConfigurationInformer) Lister() v1alpha1.ExternalAdmissionHookConfigurationLister {

View File

@ -41,8 +41,11 @@ type initializerConfigurationInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newInitializerConfigurationInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.AdmissionregistrationV1alpha1().InitializerConfigurations().List(options)
@ -53,14 +56,16 @@ func newInitializerConfigurationInformer(client kubernetes.Interface, resyncPeri
},
&admissionregistration_v1alpha1.InitializerConfiguration{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultInitializerConfigurationInformer(client kubernetes.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_v1alpha1.InitializerConfiguration{}, newInitializerConfigurationInformer)
return f.factory.InformerFor(&admissionregistration_v1alpha1.InitializerConfiguration{}, defaultInitializerConfigurationInformer)
}
func (f *initializerConfigurationInformer) Lister() v1alpha1.InitializerConfigurationLister {

View File

@ -41,26 +41,31 @@ type controllerRevisionInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newControllerRevisionInformer(client kubernetes.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 kubernetes.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.AppsV1beta1().ControllerRevisions(v1.NamespaceAll).List(options)
return client.AppsV1beta1().ControllerRevisions(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.AppsV1beta1().ControllerRevisions(v1.NamespaceAll).Watch(options)
return client.AppsV1beta1().ControllerRevisions(namespace).Watch(options)
},
},
&apps_v1beta1.ControllerRevision{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultControllerRevisionInformer(client kubernetes.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_v1beta1.ControllerRevision{}, newControllerRevisionInformer)
return f.factory.InformerFor(&apps_v1beta1.ControllerRevision{}, defaultControllerRevisionInformer)
}
func (f *controllerRevisionInformer) Lister() v1beta1.ControllerRevisionLister {

View File

@ -41,26 +41,31 @@ type deploymentInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newDeploymentInformer(client kubernetes.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 kubernetes.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.AppsV1beta1().Deployments(v1.NamespaceAll).List(options)
return client.AppsV1beta1().Deployments(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.AppsV1beta1().Deployments(v1.NamespaceAll).Watch(options)
return client.AppsV1beta1().Deployments(namespace).Watch(options)
},
},
&apps_v1beta1.Deployment{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultDeploymentInformer(client kubernetes.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(&apps_v1beta1.Deployment{}, newDeploymentInformer)
return f.factory.InformerFor(&apps_v1beta1.Deployment{}, defaultDeploymentInformer)
}
func (f *deploymentInformer) Lister() v1beta1.DeploymentLister {

View File

@ -41,26 +41,31 @@ type statefulSetInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newStatefulSetInformer(client kubernetes.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 kubernetes.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.AppsV1beta1().StatefulSets(v1.NamespaceAll).List(options)
return client.AppsV1beta1().StatefulSets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.AppsV1beta1().StatefulSets(v1.NamespaceAll).Watch(options)
return client.AppsV1beta1().StatefulSets(namespace).Watch(options)
},
},
&apps_v1beta1.StatefulSet{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultStatefulSetInformer(client kubernetes.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_v1beta1.StatefulSet{}, newStatefulSetInformer)
return f.factory.InformerFor(&apps_v1beta1.StatefulSet{}, defaultStatefulSetInformer)
}
func (f *statefulSetInformer) Lister() v1beta1.StatefulSetLister {

View File

@ -41,26 +41,31 @@ type deploymentInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newDeploymentInformer(client kubernetes.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 kubernetes.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.AppsV1beta2().Deployments(v1.NamespaceAll).List(options)
return client.AppsV1beta2().Deployments(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.AppsV1beta2().Deployments(v1.NamespaceAll).Watch(options)
return client.AppsV1beta2().Deployments(namespace).Watch(options)
},
},
&apps_v1beta2.Deployment{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultDeploymentInformer(client kubernetes.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(&apps_v1beta2.Deployment{}, newDeploymentInformer)
return f.factory.InformerFor(&apps_v1beta2.Deployment{}, defaultDeploymentInformer)
}
func (f *deploymentInformer) Lister() v1beta2.DeploymentLister {

View File

@ -41,26 +41,31 @@ type statefulSetInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newStatefulSetInformer(client kubernetes.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 kubernetes.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.AppsV1beta2().StatefulSets(v1.NamespaceAll).List(options)
return client.AppsV1beta2().StatefulSets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.AppsV1beta2().StatefulSets(v1.NamespaceAll).Watch(options)
return client.AppsV1beta2().StatefulSets(namespace).Watch(options)
},
},
&apps_v1beta2.StatefulSet{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultStatefulSetInformer(client kubernetes.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_v1beta2.StatefulSet{}, newStatefulSetInformer)
return f.factory.InformerFor(&apps_v1beta2.StatefulSet{}, defaultStatefulSetInformer)
}
func (f *statefulSetInformer) Lister() v1beta2.StatefulSetLister {

View File

@ -41,26 +41,31 @@ type horizontalPodAutoscalerInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newHorizontalPodAutoscalerInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.AutoscalingV1().HorizontalPodAutoscalers(meta_v1.NamespaceAll).List(options)
return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.AutoscalingV1().HorizontalPodAutoscalers(meta_v1.NamespaceAll).Watch(options)
return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(options)
},
},
&autoscaling_v1.HorizontalPodAutoscaler{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultHorizontalPodAutoscalerInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewHorizontalPodAutoscalerInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *horizontalPodAutoscalerInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&autoscaling_v1.HorizontalPodAutoscaler{}, newHorizontalPodAutoscalerInformer)
return f.factory.InformerFor(&autoscaling_v1.HorizontalPodAutoscaler{}, defaultHorizontalPodAutoscalerInformer)
}
func (f *horizontalPodAutoscalerInformer) Lister() v1.HorizontalPodAutoscalerLister {

View File

@ -41,26 +41,31 @@ type horizontalPodAutoscalerInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newHorizontalPodAutoscalerInformer(client kubernetes.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 kubernetes.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.AutoscalingV2alpha1().HorizontalPodAutoscalers(v1.NamespaceAll).List(options)
return client.AutoscalingV2alpha1().HorizontalPodAutoscalers(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.AutoscalingV2alpha1().HorizontalPodAutoscalers(v1.NamespaceAll).Watch(options)
return client.AutoscalingV2alpha1().HorizontalPodAutoscalers(namespace).Watch(options)
},
},
&autoscaling_v2alpha1.HorizontalPodAutoscaler{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultHorizontalPodAutoscalerInformer(client kubernetes.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_v2alpha1.HorizontalPodAutoscaler{}, newHorizontalPodAutoscalerInformer)
return f.factory.InformerFor(&autoscaling_v2alpha1.HorizontalPodAutoscaler{}, defaultHorizontalPodAutoscalerInformer)
}
func (f *horizontalPodAutoscalerInformer) Lister() v2alpha1.HorizontalPodAutoscalerLister {

View File

@ -41,26 +41,31 @@ type jobInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newJobInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.BatchV1().Jobs(meta_v1.NamespaceAll).List(options)
return client.BatchV1().Jobs(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.BatchV1().Jobs(meta_v1.NamespaceAll).Watch(options)
return client.BatchV1().Jobs(namespace).Watch(options)
},
},
&batch_v1.Job{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultJobInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewJobInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *jobInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&batch_v1.Job{}, newJobInformer)
return f.factory.InformerFor(&batch_v1.Job{}, defaultJobInformer)
}
func (f *jobInformer) Lister() v1.JobLister {

View File

@ -41,26 +41,31 @@ type cronJobInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newCronJobInformer(client kubernetes.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 kubernetes.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.BatchV2alpha1().CronJobs(v1.NamespaceAll).List(options)
return client.BatchV2alpha1().CronJobs(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.BatchV2alpha1().CronJobs(v1.NamespaceAll).Watch(options)
return client.BatchV2alpha1().CronJobs(namespace).Watch(options)
},
},
&batch_v2alpha1.CronJob{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultCronJobInformer(client kubernetes.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_v2alpha1.CronJob{}, newCronJobInformer)
return f.factory.InformerFor(&batch_v2alpha1.CronJob{}, defaultCronJobInformer)
}
func (f *cronJobInformer) Lister() v2alpha1.CronJobLister {

View File

@ -41,8 +41,11 @@ type certificateSigningRequestInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newCertificateSigningRequestInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.CertificatesV1beta1().CertificateSigningRequests().List(options)
@ -53,14 +56,16 @@ func newCertificateSigningRequestInformer(client kubernetes.Interface, resyncPer
},
&certificates_v1beta1.CertificateSigningRequest{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultCertificateSigningRequestInformer(client kubernetes.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_v1beta1.CertificateSigningRequest{}, newCertificateSigningRequestInformer)
return f.factory.InformerFor(&certificates_v1beta1.CertificateSigningRequest{}, defaultCertificateSigningRequestInformer)
}
func (f *certificateSigningRequestInformer) Lister() v1beta1.CertificateSigningRequestLister {

View File

@ -41,8 +41,11 @@ type componentStatusInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newComponentStatusInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().ComponentStatuses().List(options)
@ -53,14 +56,16 @@ func newComponentStatusInformer(client kubernetes.Interface, resyncPeriod time.D
},
&core_v1.ComponentStatus{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultComponentStatusInformer(client kubernetes.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(&core_v1.ComponentStatus{}, newComponentStatusInformer)
return f.factory.InformerFor(&core_v1.ComponentStatus{}, defaultComponentStatusInformer)
}
func (f *componentStatusInformer) Lister() v1.ComponentStatusLister {

View File

@ -41,26 +41,31 @@ type configMapInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newConfigMapInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().ConfigMaps(meta_v1.NamespaceAll).List(options)
return client.CoreV1().ConfigMaps(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().ConfigMaps(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().ConfigMaps(namespace).Watch(options)
},
},
&core_v1.ConfigMap{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultConfigMapInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewConfigMapInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *configMapInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.ConfigMap{}, newConfigMapInformer)
return f.factory.InformerFor(&core_v1.ConfigMap{}, defaultConfigMapInformer)
}
func (f *configMapInformer) Lister() v1.ConfigMapLister {

View File

@ -41,26 +41,31 @@ type endpointsInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newEndpointsInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Endpoints(meta_v1.NamespaceAll).List(options)
return client.CoreV1().Endpoints(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().Endpoints(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().Endpoints(namespace).Watch(options)
},
},
&core_v1.Endpoints{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultEndpointsInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewEndpointsInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *endpointsInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.Endpoints{}, newEndpointsInformer)
return f.factory.InformerFor(&core_v1.Endpoints{}, defaultEndpointsInformer)
}
func (f *endpointsInformer) Lister() v1.EndpointsLister {

View File

@ -41,26 +41,31 @@ type eventInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newEventInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Events(meta_v1.NamespaceAll).List(options)
return client.CoreV1().Events(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().Events(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().Events(namespace).Watch(options)
},
},
&core_v1.Event{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultEventInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewEventInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *eventInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.Event{}, newEventInformer)
return f.factory.InformerFor(&core_v1.Event{}, defaultEventInformer)
}
func (f *eventInformer) Lister() v1.EventLister {

View File

@ -41,26 +41,31 @@ type limitRangeInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newLimitRangeInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().LimitRanges(meta_v1.NamespaceAll).List(options)
return client.CoreV1().LimitRanges(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().LimitRanges(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().LimitRanges(namespace).Watch(options)
},
},
&core_v1.LimitRange{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultLimitRangeInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewLimitRangeInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *limitRangeInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.LimitRange{}, newLimitRangeInformer)
return f.factory.InformerFor(&core_v1.LimitRange{}, defaultLimitRangeInformer)
}
func (f *limitRangeInformer) Lister() v1.LimitRangeLister {

View File

@ -41,8 +41,11 @@ type namespaceInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newNamespaceInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Namespaces().List(options)
@ -53,14 +56,16 @@ func newNamespaceInformer(client kubernetes.Interface, resyncPeriod time.Duratio
},
&core_v1.Namespace{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultNamespaceInformer(client kubernetes.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(&core_v1.Namespace{}, newNamespaceInformer)
return f.factory.InformerFor(&core_v1.Namespace{}, defaultNamespaceInformer)
}
func (f *namespaceInformer) Lister() v1.NamespaceLister {

View File

@ -41,8 +41,11 @@ type nodeInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newNodeInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Nodes().List(options)
@ -53,14 +56,16 @@ func newNodeInformer(client kubernetes.Interface, resyncPeriod time.Duration) ca
},
&core_v1.Node{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultNodeInformer(client kubernetes.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(&core_v1.Node{}, newNodeInformer)
return f.factory.InformerFor(&core_v1.Node{}, defaultNodeInformer)
}
func (f *nodeInformer) Lister() v1.NodeLister {

View File

@ -41,8 +41,11 @@ type persistentVolumeInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPersistentVolumeInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().PersistentVolumes().List(options)
@ -53,14 +56,16 @@ func newPersistentVolumeInformer(client kubernetes.Interface, resyncPeriod time.
},
&core_v1.PersistentVolume{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPersistentVolumeInformer(client kubernetes.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(&core_v1.PersistentVolume{}, newPersistentVolumeInformer)
return f.factory.InformerFor(&core_v1.PersistentVolume{}, defaultPersistentVolumeInformer)
}
func (f *persistentVolumeInformer) Lister() v1.PersistentVolumeLister {

View File

@ -41,26 +41,31 @@ type persistentVolumeClaimInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPersistentVolumeClaimInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().PersistentVolumeClaims(meta_v1.NamespaceAll).List(options)
return client.CoreV1().PersistentVolumeClaims(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().PersistentVolumeClaims(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().PersistentVolumeClaims(namespace).Watch(options)
},
},
&core_v1.PersistentVolumeClaim{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPersistentVolumeClaimInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewPersistentVolumeClaimInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *persistentVolumeClaimInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.PersistentVolumeClaim{}, newPersistentVolumeClaimInformer)
return f.factory.InformerFor(&core_v1.PersistentVolumeClaim{}, defaultPersistentVolumeClaimInformer)
}
func (f *persistentVolumeClaimInformer) Lister() v1.PersistentVolumeClaimLister {

View File

@ -41,26 +41,31 @@ type podInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPodInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Pods(meta_v1.NamespaceAll).List(options)
return client.CoreV1().Pods(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().Pods(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().Pods(namespace).Watch(options)
},
},
&core_v1.Pod{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPodInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewPodInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *podInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.Pod{}, newPodInformer)
return f.factory.InformerFor(&core_v1.Pod{}, defaultPodInformer)
}
func (f *podInformer) Lister() v1.PodLister {

View File

@ -41,26 +41,31 @@ type podTemplateInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPodTemplateInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().PodTemplates(meta_v1.NamespaceAll).List(options)
return client.CoreV1().PodTemplates(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().PodTemplates(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().PodTemplates(namespace).Watch(options)
},
},
&core_v1.PodTemplate{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPodTemplateInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewPodTemplateInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *podTemplateInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.PodTemplate{}, newPodTemplateInformer)
return f.factory.InformerFor(&core_v1.PodTemplate{}, defaultPodTemplateInformer)
}
func (f *podTemplateInformer) Lister() v1.PodTemplateLister {

View File

@ -41,26 +41,31 @@ type replicationControllerInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newReplicationControllerInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().ReplicationControllers(meta_v1.NamespaceAll).List(options)
return client.CoreV1().ReplicationControllers(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().ReplicationControllers(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().ReplicationControllers(namespace).Watch(options)
},
},
&core_v1.ReplicationController{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultReplicationControllerInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewReplicationControllerInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *replicationControllerInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.ReplicationController{}, newReplicationControllerInformer)
return f.factory.InformerFor(&core_v1.ReplicationController{}, defaultReplicationControllerInformer)
}
func (f *replicationControllerInformer) Lister() v1.ReplicationControllerLister {

View File

@ -41,26 +41,31 @@ type resourceQuotaInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newResourceQuotaInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().ResourceQuotas(meta_v1.NamespaceAll).List(options)
return client.CoreV1().ResourceQuotas(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().ResourceQuotas(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().ResourceQuotas(namespace).Watch(options)
},
},
&core_v1.ResourceQuota{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultResourceQuotaInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewResourceQuotaInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *resourceQuotaInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.ResourceQuota{}, newResourceQuotaInformer)
return f.factory.InformerFor(&core_v1.ResourceQuota{}, defaultResourceQuotaInformer)
}
func (f *resourceQuotaInformer) Lister() v1.ResourceQuotaLister {

View File

@ -41,26 +41,31 @@ type secretInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newSecretInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Secrets(meta_v1.NamespaceAll).List(options)
return client.CoreV1().Secrets(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().Secrets(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().Secrets(namespace).Watch(options)
},
},
&core_v1.Secret{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultSecretInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewSecretInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *secretInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.Secret{}, newSecretInformer)
return f.factory.InformerFor(&core_v1.Secret{}, defaultSecretInformer)
}
func (f *secretInformer) Lister() v1.SecretLister {

View File

@ -41,26 +41,31 @@ type serviceInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newServiceInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().Services(meta_v1.NamespaceAll).List(options)
return client.CoreV1().Services(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().Services(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().Services(namespace).Watch(options)
},
},
&core_v1.Service{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultServiceInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewServiceInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *serviceInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.Service{}, newServiceInformer)
return f.factory.InformerFor(&core_v1.Service{}, defaultServiceInformer)
}
func (f *serviceInformer) Lister() v1.ServiceLister {

View File

@ -41,26 +41,31 @@ type serviceAccountInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newServiceAccountInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.CoreV1().ServiceAccounts(meta_v1.NamespaceAll).List(options)
return client.CoreV1().ServiceAccounts(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.CoreV1().ServiceAccounts(meta_v1.NamespaceAll).Watch(options)
return client.CoreV1().ServiceAccounts(namespace).Watch(options)
},
},
&core_v1.ServiceAccount{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultServiceAccountInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewServiceAccountInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *serviceAccountInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&core_v1.ServiceAccount{}, newServiceAccountInformer)
return f.factory.InformerFor(&core_v1.ServiceAccount{}, defaultServiceAccountInformer)
}
func (f *serviceAccountInformer) Lister() v1.ServiceAccountLister {

View File

@ -41,26 +41,31 @@ type daemonSetInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newDaemonSetInformer(client kubernetes.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 kubernetes.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.ExtensionsV1beta1().DaemonSets(v1.NamespaceAll).List(options)
return client.ExtensionsV1beta1().DaemonSets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.ExtensionsV1beta1().DaemonSets(v1.NamespaceAll).Watch(options)
return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(options)
},
},
&extensions_v1beta1.DaemonSet{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultDaemonSetInformer(client kubernetes.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_v1beta1.DaemonSet{}, newDaemonSetInformer)
return f.factory.InformerFor(&extensions_v1beta1.DaemonSet{}, defaultDaemonSetInformer)
}
func (f *daemonSetInformer) Lister() v1beta1.DaemonSetLister {

View File

@ -41,26 +41,31 @@ type deploymentInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newDeploymentInformer(client kubernetes.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 kubernetes.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.ExtensionsV1beta1().Deployments(v1.NamespaceAll).List(options)
return client.ExtensionsV1beta1().Deployments(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.ExtensionsV1beta1().Deployments(v1.NamespaceAll).Watch(options)
return client.ExtensionsV1beta1().Deployments(namespace).Watch(options)
},
},
&extensions_v1beta1.Deployment{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultDeploymentInformer(client kubernetes.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_v1beta1.Deployment{}, newDeploymentInformer)
return f.factory.InformerFor(&extensions_v1beta1.Deployment{}, defaultDeploymentInformer)
}
func (f *deploymentInformer) Lister() v1beta1.DeploymentLister {

View File

@ -41,26 +41,31 @@ type ingressInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newIngressInformer(client kubernetes.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 kubernetes.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.ExtensionsV1beta1().Ingresses(v1.NamespaceAll).List(options)
return client.ExtensionsV1beta1().Ingresses(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.ExtensionsV1beta1().Ingresses(v1.NamespaceAll).Watch(options)
return client.ExtensionsV1beta1().Ingresses(namespace).Watch(options)
},
},
&extensions_v1beta1.Ingress{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultIngressInformer(client kubernetes.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_v1beta1.Ingress{}, newIngressInformer)
return f.factory.InformerFor(&extensions_v1beta1.Ingress{}, defaultIngressInformer)
}
func (f *ingressInformer) Lister() v1beta1.IngressLister {

View File

@ -41,8 +41,11 @@ type podSecurityPolicyInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPodSecurityPolicyInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.ExtensionsV1beta1().PodSecurityPolicies().List(options)
@ -53,14 +56,16 @@ func newPodSecurityPolicyInformer(client kubernetes.Interface, resyncPeriod time
},
&extensions_v1beta1.PodSecurityPolicy{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPodSecurityPolicyInformer(client kubernetes.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_v1beta1.PodSecurityPolicy{}, newPodSecurityPolicyInformer)
return f.factory.InformerFor(&extensions_v1beta1.PodSecurityPolicy{}, defaultPodSecurityPolicyInformer)
}
func (f *podSecurityPolicyInformer) Lister() v1beta1.PodSecurityPolicyLister {

View File

@ -41,26 +41,31 @@ type replicaSetInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newReplicaSetInformer(client kubernetes.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 kubernetes.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.ExtensionsV1beta1().ReplicaSets(v1.NamespaceAll).List(options)
return client.ExtensionsV1beta1().ReplicaSets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.ExtensionsV1beta1().ReplicaSets(v1.NamespaceAll).Watch(options)
return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(options)
},
},
&extensions_v1beta1.ReplicaSet{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultReplicaSetInformer(client kubernetes.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_v1beta1.ReplicaSet{}, newReplicaSetInformer)
return f.factory.InformerFor(&extensions_v1beta1.ReplicaSet{}, defaultReplicaSetInformer)
}
func (f *replicaSetInformer) Lister() v1beta1.ReplicaSetLister {

View File

@ -41,8 +41,11 @@ type thirdPartyResourceInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newThirdPartyResourceInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.ExtensionsV1beta1().ThirdPartyResources().List(options)
@ -53,14 +56,16 @@ func newThirdPartyResourceInformer(client kubernetes.Interface, resyncPeriod tim
},
&extensions_v1beta1.ThirdPartyResource{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultThirdPartyResourceInformer(client kubernetes.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_v1beta1.ThirdPartyResource{}, newThirdPartyResourceInformer)
return f.factory.InformerFor(&extensions_v1beta1.ThirdPartyResource{}, defaultThirdPartyResourceInformer)
}
func (f *thirdPartyResourceInformer) Lister() v1beta1.ThirdPartyResourceLister {

View File

@ -41,26 +41,31 @@ type networkPolicyInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newNetworkPolicyInformer(client kubernetes.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 kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.NetworkingV1().NetworkPolicies(meta_v1.NamespaceAll).List(options)
return client.NetworkingV1().NetworkPolicies(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.NetworkingV1().NetworkPolicies(meta_v1.NamespaceAll).Watch(options)
return client.NetworkingV1().NetworkPolicies(namespace).Watch(options)
},
},
&networking_v1.NetworkPolicy{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultNetworkPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewNetworkPolicyInformer(client, meta_v1.NamespaceAll, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
}
func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&networking_v1.NetworkPolicy{}, newNetworkPolicyInformer)
return f.factory.InformerFor(&networking_v1.NetworkPolicy{}, defaultNetworkPolicyInformer)
}
func (f *networkPolicyInformer) Lister() v1.NetworkPolicyLister {

View File

@ -41,26 +41,31 @@ type podDisruptionBudgetInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPodDisruptionBudgetInformer(client kubernetes.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 kubernetes.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.PolicyV1beta1().PodDisruptionBudgets(v1.NamespaceAll).List(options)
return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.PolicyV1beta1().PodDisruptionBudgets(v1.NamespaceAll).Watch(options)
return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(options)
},
},
&policy_v1beta1.PodDisruptionBudget{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPodDisruptionBudgetInformer(client kubernetes.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_v1beta1.PodDisruptionBudget{}, newPodDisruptionBudgetInformer)
return f.factory.InformerFor(&policy_v1beta1.PodDisruptionBudget{}, defaultPodDisruptionBudgetInformer)
}
func (f *podDisruptionBudgetInformer) Lister() v1beta1.PodDisruptionBudgetLister {

View File

@ -41,8 +41,11 @@ type clusterRoleInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newClusterRoleInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.RbacV1alpha1().ClusterRoles().List(options)
@ -53,14 +56,16 @@ func newClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Durat
},
&rbac_v1alpha1.ClusterRole{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultClusterRoleInformer(client kubernetes.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_v1alpha1.ClusterRole{}, newClusterRoleInformer)
return f.factory.InformerFor(&rbac_v1alpha1.ClusterRole{}, defaultClusterRoleInformer)
}
func (f *clusterRoleInformer) Lister() v1alpha1.ClusterRoleLister {

View File

@ -41,8 +41,11 @@ type clusterRoleBindingInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newClusterRoleBindingInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.RbacV1alpha1().ClusterRoleBindings().List(options)
@ -53,14 +56,16 @@ func newClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod tim
},
&rbac_v1alpha1.ClusterRoleBinding{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultClusterRoleBindingInformer(client kubernetes.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_v1alpha1.ClusterRoleBinding{}, newClusterRoleBindingInformer)
return f.factory.InformerFor(&rbac_v1alpha1.ClusterRoleBinding{}, defaultClusterRoleBindingInformer)
}
func (f *clusterRoleBindingInformer) Lister() v1alpha1.ClusterRoleBindingLister {

View File

@ -41,26 +41,31 @@ type roleInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newRoleInformer(client kubernetes.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 kubernetes.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.RbacV1alpha1().Roles(v1.NamespaceAll).List(options)
return client.RbacV1alpha1().Roles(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.RbacV1alpha1().Roles(v1.NamespaceAll).Watch(options)
return client.RbacV1alpha1().Roles(namespace).Watch(options)
},
},
&rbac_v1alpha1.Role{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultRoleInformer(client kubernetes.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_v1alpha1.Role{}, newRoleInformer)
return f.factory.InformerFor(&rbac_v1alpha1.Role{}, defaultRoleInformer)
}
func (f *roleInformer) Lister() v1alpha1.RoleLister {

View File

@ -41,26 +41,31 @@ type roleBindingInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newRoleBindingInformer(client kubernetes.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 kubernetes.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.RbacV1alpha1().RoleBindings(v1.NamespaceAll).List(options)
return client.RbacV1alpha1().RoleBindings(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.RbacV1alpha1().RoleBindings(v1.NamespaceAll).Watch(options)
return client.RbacV1alpha1().RoleBindings(namespace).Watch(options)
},
},
&rbac_v1alpha1.RoleBinding{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultRoleBindingInformer(client kubernetes.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_v1alpha1.RoleBinding{}, newRoleBindingInformer)
return f.factory.InformerFor(&rbac_v1alpha1.RoleBinding{}, defaultRoleBindingInformer)
}
func (f *roleBindingInformer) Lister() v1alpha1.RoleBindingLister {

View File

@ -41,8 +41,11 @@ type clusterRoleInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newClusterRoleInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.RbacV1beta1().ClusterRoles().List(options)
@ -53,14 +56,16 @@ func newClusterRoleInformer(client kubernetes.Interface, resyncPeriod time.Durat
},
&rbac_v1beta1.ClusterRole{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultClusterRoleInformer(client kubernetes.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_v1beta1.ClusterRole{}, newClusterRoleInformer)
return f.factory.InformerFor(&rbac_v1beta1.ClusterRole{}, defaultClusterRoleInformer)
}
func (f *clusterRoleInformer) Lister() v1beta1.ClusterRoleLister {

View File

@ -41,8 +41,11 @@ type clusterRoleBindingInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newClusterRoleBindingInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.RbacV1beta1().ClusterRoleBindings().List(options)
@ -53,14 +56,16 @@ func newClusterRoleBindingInformer(client kubernetes.Interface, resyncPeriod tim
},
&rbac_v1beta1.ClusterRoleBinding{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultClusterRoleBindingInformer(client kubernetes.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_v1beta1.ClusterRoleBinding{}, newClusterRoleBindingInformer)
return f.factory.InformerFor(&rbac_v1beta1.ClusterRoleBinding{}, defaultClusterRoleBindingInformer)
}
func (f *clusterRoleBindingInformer) Lister() v1beta1.ClusterRoleBindingLister {

View File

@ -41,26 +41,31 @@ type roleInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newRoleInformer(client kubernetes.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 kubernetes.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.RbacV1beta1().Roles(v1.NamespaceAll).List(options)
return client.RbacV1beta1().Roles(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.RbacV1beta1().Roles(v1.NamespaceAll).Watch(options)
return client.RbacV1beta1().Roles(namespace).Watch(options)
},
},
&rbac_v1beta1.Role{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultRoleInformer(client kubernetes.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_v1beta1.Role{}, newRoleInformer)
return f.factory.InformerFor(&rbac_v1beta1.Role{}, defaultRoleInformer)
}
func (f *roleInformer) Lister() v1beta1.RoleLister {

View File

@ -41,26 +41,31 @@ type roleBindingInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newRoleBindingInformer(client kubernetes.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 kubernetes.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.RbacV1beta1().RoleBindings(v1.NamespaceAll).List(options)
return client.RbacV1beta1().RoleBindings(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.RbacV1beta1().RoleBindings(v1.NamespaceAll).Watch(options)
return client.RbacV1beta1().RoleBindings(namespace).Watch(options)
},
},
&rbac_v1beta1.RoleBinding{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultRoleBindingInformer(client kubernetes.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_v1beta1.RoleBinding{}, newRoleBindingInformer)
return f.factory.InformerFor(&rbac_v1beta1.RoleBinding{}, defaultRoleBindingInformer)
}
func (f *roleBindingInformer) Lister() v1beta1.RoleBindingLister {

View File

@ -41,8 +41,11 @@ type priorityClassInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPriorityClassInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.SchedulingV1alpha1().PriorityClasses().List(options)
@ -53,14 +56,16 @@ func newPriorityClassInformer(client kubernetes.Interface, resyncPeriod time.Dur
},
&scheduling_v1alpha1.PriorityClass{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPriorityClassInformer(client kubernetes.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_v1alpha1.PriorityClass{}, newPriorityClassInformer)
return f.factory.InformerFor(&scheduling_v1alpha1.PriorityClass{}, defaultPriorityClassInformer)
}
func (f *priorityClassInformer) Lister() v1alpha1.PriorityClassLister {

View File

@ -41,26 +41,31 @@ type podPresetInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newPodPresetInformer(client kubernetes.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 kubernetes.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.SettingsV1alpha1().PodPresets(v1.NamespaceAll).List(options)
return client.SettingsV1alpha1().PodPresets(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
return client.SettingsV1alpha1().PodPresets(v1.NamespaceAll).Watch(options)
return client.SettingsV1alpha1().PodPresets(namespace).Watch(options)
},
},
&settings_v1alpha1.PodPreset{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultPodPresetInformer(client kubernetes.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_v1alpha1.PodPreset{}, newPodPresetInformer)
return f.factory.InformerFor(&settings_v1alpha1.PodPreset{}, defaultPodPresetInformer)
}
func (f *podPresetInformer) Lister() v1alpha1.PodPresetLister {

View File

@ -41,8 +41,11 @@ type storageClassInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newStorageClassInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.StorageV1().StorageClasses().List(options)
@ -53,14 +56,16 @@ func newStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Dura
},
&storage_v1.StorageClass{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultStorageClassInformer(client kubernetes.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_v1.StorageClass{}, newStorageClassInformer)
return f.factory.InformerFor(&storage_v1.StorageClass{}, defaultStorageClassInformer)
}
func (f *storageClassInformer) Lister() v1.StorageClassLister {

View File

@ -41,8 +41,11 @@ type storageClassInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newStorageClassInformer(client kubernetes.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 kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
return client.StorageV1beta1().StorageClasses().List(options)
@ -53,14 +56,16 @@ func newStorageClassInformer(client kubernetes.Interface, resyncPeriod time.Dura
},
&storage_v1beta1.StorageClass{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
indexers,
)
}
return sharedIndexInformer
func defaultStorageClassInformer(client kubernetes.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_v1beta1.StorageClass{}, newStorageClassInformer)
return f.factory.InformerFor(&storage_v1beta1.StorageClass{}, defaultStorageClassInformer)
}
func (f *storageClassInformer) Lister() v1beta1.StorageClassLister {