Documentation
¶
Index ¶
- func IsAPINamespaced(obj runtime.Object, scheme *runtime.Scheme, restmapper apimeta.RESTMapper) (bool, error)
- func IsAPINamespacedWithGVK(gk schema.GroupVersionKind, scheme *runtime.Scheme, ...) (bool, error)
- func ScopedCacheBuilder() cache.NewCacheFunc
- type NamespacedResourceCache
- type NamespacedResourceInformer
- type ResourceCache
- type ResourceInformer
- type ScopedCache
- func (sc *ScopedCache) AddResourceCache(resource client.Object, cache cache.Cache) error
- func (sc *ScopedCache) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func (sc *ScopedCache) GetInformer(ctx context.Context, obj client.Object) (cache.Informer, error)
- func (sc *ScopedCache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)
- func (sc *ScopedCache) GetResourceCache() NamespacedResourceCache
- func (sc *ScopedCache) IndexField(ctx context.Context, obj client.Object, field string, ...) error
- func (sc *ScopedCache) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (sc *ScopedCache) ListForNamespace(ctx context.Context, list client.ObjectList, namespace string, ...) error
- func (sc *ScopedCache) RemoveResourceCache(resource client.Object) error
- func (sc *ScopedCache) Start(ctx context.Context) error
- func (sc *ScopedCache) StartResourceCache(ctx context.Context, resource client.Object)
- func (sc *ScopedCache) WaitForCacheSync(ctx context.Context) bool
- type ScopedInformer
- func (i *ScopedInformer) AddEventHandler(handler toolscache.ResourceEventHandler)
- func (i *ScopedInformer) AddEventHandlerWithResyncPeriod(handler toolscache.ResourceEventHandler, resyncPeriod time.Duration)
- func (i *ScopedInformer) AddIndexers(indexers toolscache.Indexers) error
- func (i *ScopedInformer) HasSynced() bool
- func (i *ScopedInformer) SetWatchErrorHandler(handler toolscache.WatchErrorHandler) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAPINamespaced ¶
func IsAPINamespaced(obj runtime.Object, scheme *runtime.Scheme, restmapper apimeta.RESTMapper) (bool, error)
IsAPINamespaced returns true if the object is namespace scoped. For unstructured objects the gvk is found from the object itself.
func IsAPINamespacedWithGVK ¶
func IsAPINamespacedWithGVK(gk schema.GroupVersionKind, scheme *runtime.Scheme, restmapper apimeta.RESTMapper) (bool, error)
IsAPINamespacedWithGVK returns true if the object having the provided GVK is namespace scoped.
func ScopedCacheBuilder ¶
func ScopedCacheBuilder() cache.NewCacheFunc
Types ¶
type NamespacedResourceCache ¶
type NamespacedResourceCache map[string]ResourceCache
type NamespacedResourceInformer ¶
type NamespacedResourceInformer map[string]ResourceInformer
type ScopedCache ¶
type ScopedCache struct { RESTMapper apimeta.RESTMapper Scheme *runtime.Scheme // contains filtered or unexported fields }
func (*ScopedCache) AddResourceCache ¶
AddResourceCache will add a cache for a particular resource
func (*ScopedCache) GetInformer ¶
Update to this: It turns out that if the informer is not able to connect, it blocks. This makes it so that any other CRs don't get reconciled. We will have to omit getting particular informers if the ServiceAccount does not have permissions
func (*ScopedCache) GetInformerForKind ¶
func (sc *ScopedCache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)
func (*ScopedCache) GetResourceCache ¶
func (sc *ScopedCache) GetResourceCache() NamespacedResourceCache
GetResourceCache will return the mapping of Namespace -> Resource -> Cache
func (*ScopedCache) IndexField ¶
func (sc *ScopedCache) IndexField(ctx context.Context, obj client.Object, field string, extractValue client.IndexerFunc) error
func (*ScopedCache) List ¶
func (sc *ScopedCache) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
func (*ScopedCache) ListForNamespace ¶
func (sc *ScopedCache) ListForNamespace(ctx context.Context, list client.ObjectList, namespace string, opts ...client.ListOption) error
func (*ScopedCache) RemoveResourceCache ¶
func (sc *ScopedCache) RemoveResourceCache(resource client.Object) error
RemoveResourceCache will remove a cache for a particular resource
func (*ScopedCache) StartResourceCache ¶
func (sc *ScopedCache) StartResourceCache(ctx context.Context, resource client.Object)
StartResourceCache used to start a ResourceCache after it has been added
func (*ScopedCache) WaitForCacheSync ¶
func (sc *ScopedCache) WaitForCacheSync(ctx context.Context) bool
type ScopedInformer ¶
type ScopedInformer struct {
// contains filtered or unexported fields
}
func (*ScopedInformer) AddEventHandler ¶
func (i *ScopedInformer) AddEventHandler(handler toolscache.ResourceEventHandler)
AddEventHandler adds the handler to each informer.
func (*ScopedInformer) AddEventHandlerWithResyncPeriod ¶
func (i *ScopedInformer) AddEventHandlerWithResyncPeriod(handler toolscache.ResourceEventHandler, resyncPeriod time.Duration)
AddEventHandlerWithResyncPeriod adds the handler with a resync period to each informer.
func (*ScopedInformer) AddIndexers ¶
func (i *ScopedInformer) AddIndexers(indexers toolscache.Indexers) error
AddIndexers adds the indexer for each informer.
func (*ScopedInformer) HasSynced ¶
func (i *ScopedInformer) HasSynced() bool
HasSynced checks if each informer has synced.
func (*ScopedInformer) SetWatchErrorHandler ¶
func (i *ScopedInformer) SetWatchErrorHandler(handler toolscache.WatchErrorHandler) error
SetWatchErrorHandler will attempt to set the watch error handler on the informer