(restConfig *rest.Config, opts Options)
| 506 | type newCacheFunc func(config Config, namespace string) Cache |
| 507 | |
| 508 | func 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 | |
| 533 | func defaultOpts(config *rest.Config, opts Options) (Options, error) { |
| 534 | config = rest.CopyConfig(config) |
no test coverage detected
searching dependent graphs…