cache

package
v1.14.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package cache includes controller caches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericCache

type GenericCache struct {
	client.Reader
}

GenericCache wraps a client.Reader to add a single convenience method, UnstructuredList, that returns a slice of *unstructured.Unstructured.

func NewGenericResourceCache

func NewGenericResourceCache(reader client.Reader) *GenericCache

NewGenericResourceCache returns a new GenericCache.

func (*GenericCache) UnstructuredList

func (c *GenericCache) UnstructuredList(ctx context.Context, gvk schema.GroupVersionKind,
	opts ...client.ListOption) ([]*unstructured.Unstructured, error)

UnstructuredList returns all the resources in the cluster of the given GroupVersionKind for the given namespace. If the namespace is empty, it will return all resources across all namespaces. Namespace should always be set to empty when listing cluster-scoped resources. This method is needed because cache.Cache's List method requires knowing the type of the resource you wanted to list. We always want to return Unstructureds when listing resources on the cluster, whether it's a native or custom resource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL