Documentation ¶
Index ¶
- type ClusterScopedCache
- func (csc *ClusterScopedCache) AddInformer(infOpts components.InformerOptions)
- func (csc *ClusterScopedCache) Get(key types.NamespacedName, gvk schema.GroupVersionKind) (runtime.Object, error)
- func (csc *ClusterScopedCache) HasInformer(infOpts components.InformerOptions) bool
- func (csc *ClusterScopedCache) IsStarted() bool
- func (csc *ClusterScopedCache) List(listOpts client.ListOptions, gvk schema.GroupVersionKind) ([]runtime.Object, error)
- func (csc *ClusterScopedCache) RemoveInformer(infOpts components.InformerOptions, force bool)
- func (csc *ClusterScopedCache) Start()
- func (csc *ClusterScopedCache) Synced() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterScopedCache ¶
type ClusterScopedCache struct { GvkInformers components.GvkToInformers // contains filtered or unexported fields }
ClusterScopedCache is a dynamic cache with a focus on only tracking informers with watches at a cluster level
func NewClusterScopedCache ¶
func NewClusterScopedCache() *ClusterScopedCache
NewClusterScopedCache returns a new ClusterScopedCache
func (*ClusterScopedCache) AddInformer ¶
func (csc *ClusterScopedCache) AddInformer(infOpts components.InformerOptions)
AddInformer will add a new informer to the ClusterScopedCache based on the informer options provided. The general flow of this function is: - Create a new ScopeInformer - Add the ScopeInformer to the cache based on the provided options - Set the WatchErrorHandler on the ScopeInformer to forcefully remove the ScopeInformer from the cache - If the ClusterScopedCache has been started, start the ScopeInformer
func (*ClusterScopedCache) Get ¶
func (csc *ClusterScopedCache) Get(key types.NamespacedName, gvk schema.GroupVersionKind) (runtime.Object, error)
Get will attempt to get a Kubernetes resource from the cache for the provided key and GVK. The general flow of this function is: - If an informer doesn't exist that can facilitate finding a resource based on the GVK an InformerNotFoundErr will be returned - Every Informer for a GVK will be queried. -- If the requested resource is found it will be returned -- If the requested resource is not found a NotFound error will be returned
func (*ClusterScopedCache) HasInformer ¶
func (csc *ClusterScopedCache) HasInformer(infOpts components.InformerOptions) bool
GvkHasInformer returns whether or not an informer exists in the cache for the provided components.InformerOptions
func (*ClusterScopedCache) IsStarted ¶
func (csc *ClusterScopedCache) IsStarted() bool
IsStarted returns whether or not the cache has been started
func (*ClusterScopedCache) List ¶
func (csc *ClusterScopedCache) List(listOpts client.ListOptions, gvk schema.GroupVersionKind) ([]runtime.Object, error)
List will attempt to get a list of Kubernetes resource from the cache for the provided ListOptions and GVK. The general flow of this function is: - If an informer doesn't exist that can facilitate finding a list of resources based on the provided GVK an InformerNotFoundErr will be returned - Every Informer for a GVK will be queried and the results will be aggregated into a single list. Any errors encountered will be returned immediately. - The results will be deduplicated and returned.
func (*ClusterScopedCache) RemoveInformer ¶
func (csc *ClusterScopedCache) RemoveInformer(infOpts components.InformerOptions, force bool)
RemoveInformer will remove an informer from the ClusterScopedCache based on the informer options provided. The general flow of this function is: - Get the ScopeInformer based on the provided options - Remove the provided Dependent from the ScopeInformer - If there are no more dependents for the ScopeInformer OR the removal is forced delete the informer from the cache and terminate it. - If there are no more informers for the given GVK , remove it from the cache
func (*ClusterScopedCache) Start ¶
func (csc *ClusterScopedCache) Start()
Start will start the cache and all it's informers
func (*ClusterScopedCache) Synced ¶
func (csc *ClusterScopedCache) Synced() bool
Synced returns whether or not the cache has synced