Documentation
¶
Index ¶
- type FactoriesForNamespaces
- type ForResource
- func (w *ForResource) AddEventHandler(handler cache.ResourceEventHandler)
- func (w *ForResource) Get(name string) (runtime.Object, error)
- func (w *ForResource) GetInformers() []InformLister
- func (w *ForResource) HasSynced() bool
- func (w *ForResource) List(selector labels.Selector) ([]runtime.Object, error)
- func (w *ForResource) ListAllByNamespace(namespace string, selector labels.Selector, appendFn cache.AppendFunc) error
- func (w *ForResource) Start(stopCh <-chan struct{})
- type InformLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FactoriesForNamespaces ¶
type FactoriesForNamespaces interface {
ForResource(namespace string, resource schema.GroupVersionResource) (InformLister, error)
Namespaces() sets.String
}
FactoriesForNamespaces is a way to combine several shared informers into a single struct with unified listing power.
func NewKubeInformerFactories ¶
func NewKubeInformerFactories( allowNamespaces, denyNamespaces map[string]struct{}, kubeClient kubernetes.Interface, defaultResync time.Duration, tweakListOptions func(*metav1.ListOptions), ) FactoriesForNamespaces
NewKubeInformerFactories creates factories for kube resources for the given allowed, and denied namespaces these parameters being mutually exclusive. kubeClient, defaultResync, and tweakListOptions are being passed to the underlying informer factory.
func NewMonitoringInformerFactories ¶
func NewMonitoringInformerFactories( allowNamespaces, denyNamespaces map[string]struct{}, monitoringClient monitoring.Interface, defaultResync time.Duration, tweakListOptions func(*metav1.ListOptions), ) FactoriesForNamespaces
NewKubeInformerFactories creates factories for monitoring resources for the given allowed, and denied namespaces these parameters being mutually exclusive. monitoringClient, defaultResync, and tweakListOptions are being passed to the underlying informer factory.
type ForResource ¶
type ForResource struct {
// contains filtered or unexported fields
}
ForResource contains a slice of InformLister for a concrete resource type, one per namespace.
func NewInformersForResource ¶
func NewInformersForResource(ifs FactoriesForNamespaces, resource schema.GroupVersionResource) (*ForResource, error)
NewInformersForResource returns a composite informer exposing the most basic set of operations needed from informers and listers. It does not implement a formal interface, but exposes a minimal set of methods from underlying slice of cache.SharedIndexInformers and cache.GenericListers.
It takes a namespace aware informer factory, wrapped in a FactoriesForNamespaces interface that is able to instantiate an informer for a given namespace.
func (*ForResource) AddEventHandler ¶
func (w *ForResource) AddEventHandler(handler cache.ResourceEventHandler)
AddEventHandler registers the given handler to all wrapped informers.
func (*ForResource) Get ¶
func (w *ForResource) Get(name string) (runtime.Object, error)
Get invokes all wrapped informers and returns the first found runtime object. It returns the first ocured error.
func (*ForResource) GetInformers ¶
func (w *ForResource) GetInformers() []InformLister
GetInformers returns all wrapped informers.
func (*ForResource) HasSynced ¶
func (w *ForResource) HasSynced() bool
HasSynced returns true if all underlying informers have synced, else false.
func (*ForResource) List ¶
List lists based on the requested selector. It invokes all wrapped informers, the result is concatenated.
func (*ForResource) ListAllByNamespace ¶
func (w *ForResource) ListAllByNamespace(namespace string, selector labels.Selector, appendFn cache.AppendFunc) error
ListAllByNamespace invokes all wrapped informers passing the same appendFn. While wrapped informers are usually namespace aware, it is still important to iterate over all of them as some informers might wrap k8s.io/apimachinery/pkg/apis/meta/v1.NamespaceAll.
func (*ForResource) Start ¶
func (w *ForResource) Start(stopCh <-chan struct{})
Start starts all underlying informers, passing the given stop channel to each of them.
type InformLister ¶
type InformLister interface {
Informer() cache.SharedIndexInformer
Lister() cache.GenericLister
}
InformLister is the interface that both exposes a shared index informer and a generic lister. Usually generated clients declare this interface as "GenericInformer".