certificatesigningrequest.go 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by informer-gen. DO NOT EDIT.
  14. package v1beta1
  15. import (
  16. "context"
  17. time "time"
  18. certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
  19. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  20. runtime "k8s.io/apimachinery/pkg/runtime"
  21. watch "k8s.io/apimachinery/pkg/watch"
  22. internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
  23. kubernetes "k8s.io/client-go/kubernetes"
  24. v1beta1 "k8s.io/client-go/listers/certificates/v1beta1"
  25. cache "k8s.io/client-go/tools/cache"
  26. )
  27. // CertificateSigningRequestInformer provides access to a shared informer and lister for
  28. // CertificateSigningRequests.
  29. type CertificateSigningRequestInformer interface {
  30. Informer() cache.SharedIndexInformer
  31. Lister() v1beta1.CertificateSigningRequestLister
  32. }
  33. type certificateSigningRequestInformer struct {
  34. factory internalinterfaces.SharedInformerFactory
  35. tweakListOptions internalinterfaces.TweakListOptionsFunc
  36. }
  37. // NewCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type.
  38. // Always prefer using an informer factory to get a shared informer instead of getting an independent
  39. // one. This reduces memory footprint and number of connections to the server.
  40. func NewCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
  41. return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, indexers, nil)
  42. }
  43. // NewFilteredCertificateSigningRequestInformer constructs a new informer for CertificateSigningRequest type.
  44. // Always prefer using an informer factory to get a shared informer instead of getting an independent
  45. // one. This reduces memory footprint and number of connections to the server.
  46. func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
  47. return cache.NewSharedIndexInformer(
  48. &cache.ListWatch{
  49. ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
  50. if tweakListOptions != nil {
  51. tweakListOptions(&options)
  52. }
  53. return client.CertificatesV1beta1().CertificateSigningRequests().List(context.TODO(), options)
  54. },
  55. WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
  56. if tweakListOptions != nil {
  57. tweakListOptions(&options)
  58. }
  59. return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.TODO(), options)
  60. },
  61. },
  62. &certificatesv1beta1.CertificateSigningRequest{},
  63. resyncPeriod,
  64. indexers,
  65. )
  66. }
  67. func (f *certificateSigningRequestInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
  68. return NewFilteredCertificateSigningRequestInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
  69. }
  70. func (f *certificateSigningRequestInformer) Informer() cache.SharedIndexInformer {
  71. return f.factory.InformerFor(&certificatesv1beta1.CertificateSigningRequest{}, f.defaultInformer)
  72. }
  73. func (f *certificateSigningRequestInformer) Lister() v1beta1.CertificateSigningRequestLister {
  74. return v1beta1.NewCertificateSigningRequestLister(f.Informer().GetIndexer())
  75. }