Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GroupVersionKindAll = schema.GroupVersionKind{}
GroupVersionKindAll is the argument to represent all GroupVersionKind types.
Functions ¶
func FieldIndexName ¶
FieldIndexName constructs the name of the index over the given field, for use with an indexer.
func KeyToNamespacedKey ¶
KeyToNamespacedKey prefixes the given index key with a namespace for use in field selector indexes.
Types ¶
type CacheReader ¶
type CacheReader struct {
// contains filtered or unexported fields
}
CacheReader wraps a cache.Index to implement the client.CacheReader interface for a single type.
func (*CacheReader) Get ¶
func (c *CacheReader) Get(_ context.Context, key client.ObjectKey, out client.Object, opts ...client.GetOption) error
Get checks the indexer for the object and writes a copy of it if found.
func (*CacheReader) List ¶
func (c *CacheReader) List(_ context.Context, out client.ObjectList, opts ...client.ListOption) error
List lists items out of the indexer and writes them to out.
type DisableDeepCopyByGVK ¶ added in v0.10.0
type DisableDeepCopyByGVK map[schema.GroupVersionKind]bool
DisableDeepCopyByGVK associate a GroupVersionKind to disable DeepCopy during get or list from cache.
func (DisableDeepCopyByGVK) IsDisabled ¶ added in v0.10.0
func (disableByGVK DisableDeepCopyByGVK) IsDisabled(gvk schema.GroupVersionKind) bool
IsDisabled returns whether a GroupVersionKind is disabled DeepCopy.
type InformersMap ¶
type InformersMap struct { // Scheme maps runtime.Objects to GroupVersionKinds Scheme *runtime.Scheme // contains filtered or unexported fields }
InformersMap create and caches Informers for (runtime.Object, schema.GroupVersionKind) pairs. It uses a standard parameter codec constructed based on the given generated Scheme.
func NewInformersMap ¶
func NewInformersMap(config *rest.Config, scheme *runtime.Scheme, mapper meta.RESTMapper, resync time.Duration, namespace string, selectors SelectorsByGVK, disableDeepCopy DisableDeepCopyByGVK, transformers TransformFuncByObject, ) *InformersMap
NewInformersMap creates a new InformersMap that can create informers for both structured and unstructured objects.
func (*InformersMap) Get ¶
func (m *InformersMap) Get(ctx context.Context, gvk schema.GroupVersionKind, obj runtime.Object) (bool, *MapEntry, error)
Get will create a new Informer and add it to the map of InformersMap if none exists. Returns the Informer from the map.
func (*InformersMap) Start ¶
func (m *InformersMap) Start(ctx context.Context) error
Start calls Run on each of the informers and sets started to true. Blocks on the context.
func (*InformersMap) WaitForCacheSync ¶
func (m *InformersMap) WaitForCacheSync(ctx context.Context) bool
WaitForCacheSync waits until all the caches have been started and synced.
type MapEntry ¶
type MapEntry struct { // Informer is the cached informer Informer cache.SharedIndexInformer // CacheReader wraps Informer and implements the CacheReader interface for a single type Reader CacheReader }
MapEntry contains the cached data for an Informer.
type Selector ¶ added in v0.9.0
Selector specify the label/field selector to fill in ListOptions.
func (Selector) ApplyToList ¶ added in v0.9.0
func (s Selector) ApplyToList(listOpts *metav1.ListOptions)
ApplyToList fill in ListOptions LabelSelector and FieldSelector if needed.
type SelectorsByGVK ¶ added in v0.9.0
type SelectorsByGVK map[schema.GroupVersionKind]Selector
SelectorsByGVK associate a GroupVersionKind to a field/label selector.
type TransformFuncByObject ¶ added in v0.12.0
type TransformFuncByObject interface { Set(runtime.Object, *runtime.Scheme, cache.TransformFunc) error Get(schema.GroupVersionKind) cache.TransformFunc SetDefault(transformer cache.TransformFunc) }
TransformFuncByObject provides access to the correct transform function for any given GVK.
func NewTransformFuncByObject ¶ added in v0.12.0
func NewTransformFuncByObject() TransformFuncByObject
NewTransformFuncByObject creates a new TransformFuncByObject instance.