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

Function newCache

pkg/cache/cache.go:508–531  ·  view source on GitHub ↗
(restConfig *rest.Config, opts Options)

Source from the content-addressed store, hash-verified

506type newCacheFunc func(config Config, namespace string) Cache
507
508func newCache(restConfig *rest.Config, opts Options) newCacheFunc {
509 return func(config Config, namespace string) Cache {
510 return &informerCache{
511 scheme: opts.Scheme,
512 Informers: internal.NewInformers(restConfig, &internal.InformersOpts{
513 HTTPClient: opts.HTTPClient,
514 Scheme: opts.Scheme,
515 Mapper: opts.Mapper,
516 ResyncPeriod: ptr.Deref(config.SyncPeriod, defaultSyncPeriod),
517 Namespace: namespace,
518 Selector: internal.Selector{
519 Label: config.LabelSelector,
520 Field: config.FieldSelector,
521 },
522 Transform: config.Transform,
523 WatchErrorHandler: opts.DefaultWatchErrorHandler,
524 UnsafeDisableDeepCopy: ptr.Deref(config.UnsafeDisableDeepCopy, false),
525 EnableWatchBookmarks: ptr.Deref(config.EnableWatchBookmarks, true),
526 NewInformer: opts.NewInformer,
527 }),
528 readerFailOnMissingInformer: opts.ReaderFailOnMissingInformer,
529 }
530 }
531}
532
533func defaultOpts(config *rest.Config, opts Options) (Options, error) {
534 config = rest.CopyConfig(config)

Callers 2

NewFunction · 0.85
newMultiNamespaceCacheFunction · 0.85

Calls 1

NewInformersFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…