Documentation ¶
Index ¶
- type CachingClusterReader
- func (c *CachingClusterReader) Get(_ context.Context, key client.ObjectKey, obj *unstructured.Unstructured) error
- func (c *CachingClusterReader) ListClusterScoped(ctx context.Context, list *unstructured.UnstructuredList, ...) error
- func (c *CachingClusterReader) ListNamespaceScoped(_ context.Context, list *unstructured.UnstructuredList, namespace string, ...) error
- func (c *CachingClusterReader) Sync(ctx context.Context) error
- type DirectClusterReader
- func (n *DirectClusterReader) Get(ctx context.Context, key client.ObjectKey, obj *unstructured.Unstructured) error
- func (n *DirectClusterReader) ListClusterScoped(ctx context.Context, list *unstructured.UnstructuredList, ...) error
- func (n *DirectClusterReader) ListNamespaceScoped(ctx context.Context, list *unstructured.UnstructuredList, namespace string, ...) error
- func (n *DirectClusterReader) Sync(_ context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachingClusterReader ¶
CachingClusterReader is an implementation of the ObserverReader interface that will pre-fetch all resources needed before every sync loop. The resources needed are decided by finding all combinations of GroupVersionKind and namespace referenced by the provided identifiers. This list is then expanded to include any known generated resource types.
func NewCachingClusterReader ¶
func NewCachingClusterReader(reader client.Reader, mapper meta.RESTMapper, identifiers []wait.ResourceIdentifier) (*CachingClusterReader, error)
NewCachingClusterReader returns a new instance of the ClusterReader. The ClusterReader needs will use the clusterreader to fetch resources from the cluster, while the mapper is used to resolve the version for GroupKinds. The list of identifiers is needed so the ClusterReader can figure out which GroupKind and namespace combinations it needs to cache when the Sync function is called. We only want to fetch the resources that are actually needed.
func (*CachingClusterReader) Get ¶
func (c *CachingClusterReader) Get(_ context.Context, key client.ObjectKey, obj *unstructured.Unstructured) error
Get looks up the resource identified by the key and the object GVK in the cache. If the needed combination of GVK and namespace is not part of the cache, that is considered an error.
func (*CachingClusterReader) ListClusterScoped ¶
func (c *CachingClusterReader) ListClusterScoped(ctx context.Context, list *unstructured.UnstructuredList, selector labels.Selector) error
ListClusterScoped lists all resource identifier by the GVK of the list and selector from the cache. If the needed combination of GVK and namespace (which for clusterscoped resources will always be the empty string) is not part of the cache, that is considered an error.
func (*CachingClusterReader) ListNamespaceScoped ¶
func (c *CachingClusterReader) ListNamespaceScoped(_ context.Context, list *unstructured.UnstructuredList, namespace string, selector labels.Selector) error
ListNamespaceScoped lists all resource identifier by the GVK of the list, the namespace and the selector from the cache. If the needed combination of GVK and namespace is not part of the cache, that is considered an error.
type DirectClusterReader ¶
DirectClusterReader is an implementation of the ClusterReader that just delegates all calls directly to the underlying clusterreader. No caching.
func (*DirectClusterReader) Get ¶
func (n *DirectClusterReader) Get(ctx context.Context, key client.ObjectKey, obj *unstructured.Unstructured) error
func (*DirectClusterReader) ListClusterScoped ¶
func (n *DirectClusterReader) ListClusterScoped(ctx context.Context, list *unstructured.UnstructuredList, selector labels.Selector) error
func (*DirectClusterReader) ListNamespaceScoped ¶
func (n *DirectClusterReader) ListNamespaceScoped(ctx context.Context, list *unstructured.UnstructuredList, namespace string, selector labels.Selector) error