1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-19 10:26:25 +00:00

Add comments to clarify where non-test-mode methods are defined. (#809)

This commit is contained in:
Eric Promislow
2025-09-08 14:31:18 -07:00
committed by GitHub
parent 4bd760b22d
commit 7cff39371f
2 changed files with 4 additions and 0 deletions

View File

@@ -153,6 +153,8 @@ func (f *CacheFactory) cacheForLocked(ctx context.Context, fields [][]string, ex
_, encryptResourceAlways := defaultEncryptedResourceTypes[gvk]
shouldEncrypt := f.encryptAll || encryptResourceAlways
// In non-test code this invokes pkg/sqlcache/informer/informer.go: NewInformer()
// search for "func NewInformer(ctx"
i, err := f.newInformer(f.ctx, client, fields, externalUpdateInfo, selfUpdateInfo, transform, gvk, f.dbClient, shouldEncrypt, namespaced, watchable, f.gcInterval, f.gcKeepCount)
if err != nil {
return nil, err

View File

@@ -106,6 +106,8 @@ func NewInformer(ctx context.Context, client dynamic.ResourceInterface, fields [
// We therefore just disable it right away.
resyncPeriod := time.Duration(0)
// In non-test mode `newInformer` is cache.NewSharedIndexInformer
// defined in k8s.io/client-go/tools/cache/shared_informer.go : func NewSharedIndexInformer(lw ...
sii := newInformer(listWatcher, example, resyncPeriod, cache.Indexers{})
if transform != nil {
if err := sii.SetTransform(transform); err != nil {