MCPcopy
hub / github.com/kubernetes-sigs/controller-runtime / CacheReader

Struct CacheReader

pkg/cache/internal/cache_reader.go:41–55  ·  view source on GitHub ↗

CacheReader wraps a cache.Index to implement the client.Reader interface for a single type.

Source from the content-addressed store, hash-verified

39
40// CacheReader wraps a cache.Index to implement the client.Reader interface for a single type.
41type CacheReader struct {
42 // indexer is the underlying indexer wrapped by this cache.
43 indexer cache.Indexer
44
45 // groupVersionKind is the group-version-kind of the resource.
46 groupVersionKind schema.GroupVersionKind
47
48 // scopeName is the scope of the resource (namespaced or cluster-scoped).
49 scopeName apimeta.RESTScopeName
50
51 // disableDeepCopy indicates not to deep copy objects during get or list objects.
52 // Be very careful with this, when enabled you must DeepCopy any object before mutating it,
53 // otherwise you will mutate the object in the cache.
54 disableDeepCopy bool
55}
56
57// Get checks the indexer for the object and writes a copy of it if found.
58func (c *CacheReader) Get(_ context.Context, key client.ObjectKey, out client.Object, opts ...client.GetOption) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected