Documentation
¶
Overview ¶
Package informer provides a shared informer manager for Kubernetes resources.
Index ¶
- Constants
- type Manager
- func (m *Manager) GetFactory() informers.SharedInformerFactory
- func (m *Manager) GetNodeInformer() cache.SharedIndexInformer
- func (m *Manager) GetNodeLister() listerv1.NodeLister
- func (m *Manager) GetPodInformer() cache.SharedIndexInformer
- func (m *Manager) GetPodLister() listerv1.PodLister
- func (m *Manager) GetVAIndexer() cache.Indexer
- func (m *Manager) GetVAInformer() cache.SharedIndexInformer
- func (m *Manager) GetVALister() listerstoragev1.VolumeAttachmentLister
- func (m *Manager) IsVAAvailable() bool
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop()
- type Option
- func EnableNodeInformer() Option
- func EnablePodInformer() Option
- func WithCacheSyncTimeout(timeout time.Duration) Option
- func WithDefaultVANodeNameIndexer() Option
- func WithNodeIndexers(indexers cache.Indexers) Option
- func WithPodIndexers(indexers cache.Indexers) Option
- func WithVAIndexers(indexers cache.Indexers) Option
- type VAPermissionError
Constants ¶
const VANodeNameIndexer = "spec.nodeName"
VANodeNameIndexer is the indexer key for looking up VolumeAttachments by node name.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the global SharedInformerFactory and provides access to specific informers and listers.
func NewManager ¶
func NewManager( log logrus.FieldLogger, clientset kubernetes.Interface, resyncPeriod time.Duration, opts ...Option, ) *Manager
NewManager creates a new Manager with the given clientset and resync period.
func (*Manager) GetFactory ¶
func (m *Manager) GetFactory() informers.SharedInformerFactory
GetFactory returns the underlying SharedInformerFactory for advanced use cases.
func (*Manager) GetNodeInformer ¶
func (m *Manager) GetNodeInformer() cache.SharedIndexInformer
GetNodeInformer returns the node informer for watching node events.
func (*Manager) GetNodeLister ¶
func (m *Manager) GetNodeLister() listerv1.NodeLister
GetNodeLister returns the node lister for querying the node cache.
func (*Manager) GetPodInformer ¶
func (m *Manager) GetPodInformer() cache.SharedIndexInformer
GetPodInformer returns the pod informer for watching pod events.
func (*Manager) GetPodLister ¶
GetPodLister returns the pod lister for querying the pod cache.
func (*Manager) GetVAIndexer ¶
GetVAIndexer returns the VolumeAttachment indexer for indexed lookups. Use with VANodeNameIndexer to look up VolumeAttachments by node name. Returns nil if the VA informer is not available or not synced.
func (*Manager) GetVAInformer ¶
func (m *Manager) GetVAInformer() cache.SharedIndexInformer
GetVAInformer returns the VolumeAttachment informer for watching VA events. Returns nil if the VA informer is not available or not synced.
func (*Manager) GetVALister ¶
func (m *Manager) GetVALister() listerstoragev1.VolumeAttachmentLister
GetVALister returns the VolumeAttachment lister for querying the VA cache. Returns nil if the VA informer is not available or not synced.
func (*Manager) IsVAAvailable ¶
IsVAAvailable indicates whether the VolumeAttachment informer is available.
type Option ¶
type Option func(*Manager)
Option is a functional option for configuring the Manager.
func EnableNodeInformer ¶
func EnableNodeInformer() Option
func EnablePodInformer ¶
func EnablePodInformer() Option
func WithCacheSyncTimeout ¶
WithCacheSyncTimeout sets the timeout for waiting for informer caches to sync.
func WithDefaultVANodeNameIndexer ¶
func WithDefaultVANodeNameIndexer() Option
WithDefaultVANodeNameIndexer adds the default spec.nodeName indexer for VolumeAttachments. This is commonly used to look up VolumeAttachments by node name.
func WithNodeIndexers ¶
WithNodeIndexers sets custom indexers for the node informer.
func WithPodIndexers ¶
WithPodIndexers sets custom indexers for the pod informer.
func WithVAIndexers ¶
WithVAIndexers sets custom indexers for the VolumeAttachment informer.
type VAPermissionError ¶
type VAPermissionError struct {
// MissingVerb is the verb that was denied (e.g., "get", "list", "watch").
MissingVerb string
}
VAPermissionError indicates that required RBAC permissions for VolumeAttachments are missing.
func (*VAPermissionError) Error ¶
func (e *VAPermissionError) Error() string