rebase: update k8s.io packages to v0.29.0

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos
2023-12-20 13:23:59 +01:00
committed by mergify[bot]
parent 328a264202
commit f080b9e0c9
367 changed files with 21340 additions and 11878 deletions

View File

@ -60,6 +60,7 @@ type sharedInformerFactory struct {
lock sync.Mutex
defaultResync time.Duration
customResync map[reflect.Type]time.Duration
transform cache.TransformFunc
informers map[reflect.Type]cache.SharedIndexInformer
// startedInformers is used for tracking which informers have been started.
@ -98,6 +99,14 @@ func WithNamespace(namespace string) SharedInformerOption {
}
}
// WithTransform sets a transform on all informers.
func WithTransform(transform cache.TransformFunc) SharedInformerOption {
return func(factory *sharedInformerFactory) *sharedInformerFactory {
factory.transform = transform
return factory
}
}
// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces.
func NewSharedInformerFactory(client kubernetes.Interface, defaultResync time.Duration) SharedInformerFactory {
return NewSharedInformerFactoryWithOptions(client, defaultResync)
@ -202,6 +211,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal
}
informer = newFunc(f.client, resyncPeriod)
informer.SetTransform(f.transform)
f.informers[informerType] = informer
return informer

View File

@ -19,7 +19,7 @@ limitations under the License.
package flowcontrol
import (
v1alpha1 "k8s.io/client-go/informers/flowcontrol/v1alpha1"
v1 "k8s.io/client-go/informers/flowcontrol/v1"
v1beta1 "k8s.io/client-go/informers/flowcontrol/v1beta1"
v1beta2 "k8s.io/client-go/informers/flowcontrol/v1beta2"
v1beta3 "k8s.io/client-go/informers/flowcontrol/v1beta3"
@ -28,8 +28,8 @@ import (
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1 provides access to shared informers for resources in V1.
V1() v1.Interface
// V1beta1 provides access to shared informers for resources in V1beta1.
V1beta1() v1beta1.Interface
// V1beta2 provides access to shared informers for resources in V1beta2.
@ -49,9 +49,9 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
// V1 returns a new v1.Interface.
func (g *group) V1() v1.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions)
}
// V1beta1 returns a new v1beta1.Interface.

View File

@ -16,19 +16,19 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"context"
time "time"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
flowcontrolv1 "k8s.io/api/flowcontrol/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1alpha1 "k8s.io/client-go/listers/flowcontrol/v1alpha1"
v1 "k8s.io/client-go/listers/flowcontrol/v1"
cache "k8s.io/client-go/tools/cache"
)
@ -36,7 +36,7 @@ import (
// FlowSchemas.
type FlowSchemaInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.FlowSchemaLister
Lister() v1.FlowSchemaLister
}
type flowSchemaInformer struct {
@ -57,20 +57,20 @@ func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Durati
func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().FlowSchemas().List(context.TODO(), options)
return client.FlowcontrolV1().FlowSchemas().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().FlowSchemas().Watch(context.TODO(), options)
return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options)
},
},
&flowcontrolv1alpha1.FlowSchema{},
&flowcontrolv1.FlowSchema{},
resyncPeriod,
indexers,
)
@ -81,9 +81,9 @@ func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resync
}
func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&flowcontrolv1alpha1.FlowSchema{}, f.defaultInformer)
return f.factory.InformerFor(&flowcontrolv1.FlowSchema{}, f.defaultInformer)
}
func (f *flowSchemaInformer) Lister() v1alpha1.FlowSchemaLister {
return v1alpha1.NewFlowSchemaLister(f.Informer().GetIndexer())
func (f *flowSchemaInformer) Lister() v1.FlowSchemaLister {
return v1.NewFlowSchemaLister(f.Informer().GetIndexer())
}

View File

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"

View File

@ -16,19 +16,19 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"context"
time "time"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
flowcontrolv1 "k8s.io/api/flowcontrol/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1alpha1 "k8s.io/client-go/listers/flowcontrol/v1alpha1"
v1 "k8s.io/client-go/listers/flowcontrol/v1"
cache "k8s.io/client-go/tools/cache"
)
@ -36,7 +36,7 @@ import (
// PriorityLevelConfigurations.
type PriorityLevelConfigurationInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.PriorityLevelConfigurationLister
Lister() v1.PriorityLevelConfigurationLister
}
type priorityLevelConfigurationInformer struct {
@ -57,20 +57,20 @@ func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPe
func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(context.TODO(), options)
return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(context.TODO(), options)
return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options)
},
},
&flowcontrolv1alpha1.PriorityLevelConfiguration{},
&flowcontrolv1.PriorityLevelConfiguration{},
resyncPeriod,
indexers,
)
@ -81,9 +81,9 @@ func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.I
}
func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&flowcontrolv1alpha1.PriorityLevelConfiguration{}, f.defaultInformer)
return f.factory.InformerFor(&flowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer)
}
func (f *priorityLevelConfigurationInformer) Lister() v1alpha1.PriorityLevelConfigurationLister {
return v1alpha1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer())
func (f *priorityLevelConfigurationInformer) Lister() v1.PriorityLevelConfigurationLister {
return v1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer())
}

View File

@ -45,7 +45,7 @@ import (
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
flowcontrolv1 "k8s.io/api/flowcontrol/v1"
flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1"
flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2"
v1beta3 "k8s.io/api/flowcontrol/v1beta3"
@ -259,11 +259,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
case extensionsv1beta1.SchemeGroupVersion.WithResource("replicasets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().ReplicaSets().Informer()}, nil
// Group=flowcontrol.apiserver.k8s.io, Version=v1alpha1
case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("flowschemas"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().FlowSchemas().Informer()}, nil
case flowcontrolv1alpha1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1alpha1().PriorityLevelConfigurations().Informer()}, nil
// Group=flowcontrol.apiserver.k8s.io, Version=v1
case flowcontrolv1.SchemeGroupVersion.WithResource("flowschemas"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().FlowSchemas().Informer()}, nil
case flowcontrolv1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().PriorityLevelConfigurations().Informer()}, nil
// Group=flowcontrol.apiserver.k8s.io, Version=v1beta1
case flowcontrolv1beta1.SchemeGroupVersion.WithResource("flowschemas"):
@ -296,10 +296,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().NetworkPolicies().Informer()}, nil
// Group=networking.k8s.io, Version=v1alpha1
case networkingv1alpha1.SchemeGroupVersion.WithResource("clustercidrs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ClusterCIDRs().Informer()}, nil
case networkingv1alpha1.SchemeGroupVersion.WithResource("ipaddresses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().IPAddresses().Informer()}, nil
case networkingv1alpha1.SchemeGroupVersion.WithResource("servicecidrs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ServiceCIDRs().Informer()}, nil
// Group=networking.k8s.io, Version=v1beta1
case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"):
@ -326,8 +326,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=policy, Version=v1beta1
case policyv1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil
case policyv1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodSecurityPolicies().Informer()}, nil
// Group=rbac.authorization.k8s.io, Version=v1
case rbacv1.SchemeGroupVersion.WithResource("clusterroles"):
@ -398,6 +396,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().CSIStorageCapacities().Informer()}, nil
case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattachments"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttachments().Informer()}, nil
case storagev1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttributesClasses().Informer()}, nil
// Group=storage.k8s.io, Version=v1beta1
case storagev1beta1.SchemeGroupVersion.WithResource("csidrivers"):

View File

@ -24,10 +24,10 @@ import (
// Interface provides access to all the informers in this group version.
type Interface interface {
// ClusterCIDRs returns a ClusterCIDRInformer.
ClusterCIDRs() ClusterCIDRInformer
// IPAddresses returns a IPAddressInformer.
IPAddresses() IPAddressInformer
// ServiceCIDRs returns a ServiceCIDRInformer.
ServiceCIDRs() ServiceCIDRInformer
}
type version struct {
@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// ClusterCIDRs returns a ClusterCIDRInformer.
func (v *version) ClusterCIDRs() ClusterCIDRInformer {
return &clusterCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// IPAddresses returns a IPAddressInformer.
func (v *version) IPAddresses() IPAddressInformer {
return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// ServiceCIDRs returns a ServiceCIDRInformer.
func (v *version) ServiceCIDRs() ServiceCIDRInformer {
return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

View File

@ -32,58 +32,58 @@ import (
cache "k8s.io/client-go/tools/cache"
)
// ClusterCIDRInformer provides access to a shared informer and lister for
// ClusterCIDRs.
type ClusterCIDRInformer interface {
// ServiceCIDRInformer provides access to a shared informer and lister for
// ServiceCIDRs.
type ServiceCIDRInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ClusterCIDRLister
Lister() v1alpha1.ServiceCIDRLister
}
type clusterCIDRInformer struct {
type serviceCIDRInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewClusterCIDRInformer constructs a new informer for ClusterCIDR type.
// NewServiceCIDRInformer constructs a new informer for ServiceCIDR 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 NewClusterCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredClusterCIDRInformer(client, resyncPeriod, indexers, nil)
func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredClusterCIDRInformer constructs a new informer for ClusterCIDR type.
// NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR 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 NewFilteredClusterCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1alpha1().ClusterCIDRs().List(context.TODO(), options)
return client.NetworkingV1alpha1().ServiceCIDRs().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1alpha1().ClusterCIDRs().Watch(context.TODO(), options)
return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.TODO(), options)
},
},
&networkingv1alpha1.ClusterCIDR{},
&networkingv1alpha1.ServiceCIDR{},
resyncPeriod,
indexers,
)
}
func (f *clusterCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredClusterCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *clusterCIDRInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&networkingv1alpha1.ClusterCIDR{}, f.defaultInformer)
func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&networkingv1alpha1.ServiceCIDR{}, f.defaultInformer)
}
func (f *clusterCIDRInformer) Lister() v1alpha1.ClusterCIDRLister {
return v1alpha1.NewClusterCIDRLister(f.Informer().GetIndexer())
func (f *serviceCIDRInformer) Lister() v1alpha1.ServiceCIDRLister {
return v1alpha1.NewServiceCIDRLister(f.Informer().GetIndexer())
}

View File

@ -26,8 +26,6 @@ import (
type Interface interface {
// PodDisruptionBudgets returns a PodDisruptionBudgetInformer.
PodDisruptionBudgets() PodDisruptionBudgetInformer
// PodSecurityPolicies returns a PodSecurityPolicyInformer.
PodSecurityPolicies() PodSecurityPolicyInformer
}
type version struct {
@ -45,8 +43,3 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
func (v *version) PodDisruptionBudgets() PodDisruptionBudgetInformer {
return &podDisruptionBudgetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// PodSecurityPolicies returns a PodSecurityPolicyInformer.
func (v *version) PodSecurityPolicies() PodSecurityPolicyInformer {
return &podSecurityPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

View File

@ -1,89 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1beta1
import (
"context"
time "time"
policyv1beta1 "k8s.io/api/policy/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1beta1 "k8s.io/client-go/listers/policy/v1beta1"
cache "k8s.io/client-go/tools/cache"
)
// PodSecurityPolicyInformer provides access to a shared informer and lister for
// PodSecurityPolicies.
type PodSecurityPolicyInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta1.PodSecurityPolicyLister
}
type podSecurityPolicyInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// 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 NewFilteredPodSecurityPolicyInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredPodSecurityPolicyInformer 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 NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PolicyV1beta1().PodSecurityPolicies().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PolicyV1beta1().PodSecurityPolicies().Watch(context.TODO(), options)
},
},
&policyv1beta1.PodSecurityPolicy{},
resyncPeriod,
indexers,
)
}
func (f *podSecurityPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPodSecurityPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *podSecurityPolicyInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&policyv1beta1.PodSecurityPolicy{}, f.defaultInformer)
}
func (f *podSecurityPolicyInformer) Lister() v1beta1.PodSecurityPolicyLister {
return v1beta1.NewPodSecurityPolicyLister(f.Informer().GetIndexer())
}

View File

@ -28,6 +28,8 @@ type Interface interface {
CSIStorageCapacities() CSIStorageCapacityInformer
// VolumeAttachments returns a VolumeAttachmentInformer.
VolumeAttachments() VolumeAttachmentInformer
// VolumeAttributesClasses returns a VolumeAttributesClassInformer.
VolumeAttributesClasses() VolumeAttributesClassInformer
}
type version struct {
@ -50,3 +52,8 @@ func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer {
func (v *version) VolumeAttachments() VolumeAttachmentInformer {
return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// VolumeAttributesClasses returns a VolumeAttributesClassInformer.
func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer {
return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

View File

@ -0,0 +1,89 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
storagev1alpha1 "k8s.io/api/storage/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1"
cache "k8s.io/client-go/tools/cache"
)
// VolumeAttributesClassInformer provides access to a shared informer and lister for
// VolumeAttributesClasses.
type VolumeAttributesClassInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.VolumeAttributesClassLister
}
type volumeAttributesClassInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass 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 NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass 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 NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.StorageV1alpha1().VolumeAttributesClasses().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.TODO(), options)
},
},
&storagev1alpha1.VolumeAttributesClass{},
resyncPeriod,
indexers,
)
}
func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&storagev1alpha1.VolumeAttributesClass{}, f.defaultInformer)
}
func (f *volumeAttributesClassInformer) Lister() v1alpha1.VolumeAttributesClassLister {
return v1alpha1.NewVolumeAttributesClassLister(f.Informer().GetIndexer())
}