CacheReader wraps a cache.Index to implement the client.Reader interface for a single type.
| 39 | |
| 40 | // CacheReader wraps a cache.Index to implement the client.Reader interface for a single type. |
| 41 | type 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. |
| 58 | func (c *CacheReader) Get(_ context.Context, key client.ObjectKey, out client.Object, opts ...client.GetOption) error { |
nothing calls this directly
no outgoing calls
no test coverage detected