kubernetes/pkg/kubelet/util/manager/watch_based_manager.go

type listObjectFunc

type watchObjectFunc

type newObjectFunc

type isImmutableFunc

type objectCacheItem

func (i *objectCacheItem) stop() bool {}

func (i *objectCacheItem) stopThreadUnsafe() bool {}

func (i *objectCacheItem) setLastAccessTime(time time.Time) {}

func (i *objectCacheItem) setImmutable() {}

func (i *objectCacheItem) stopIfIdle(now time.Time, maxIdleTime time.Duration) bool {}

func (i *objectCacheItem) restartReflectorIfNeeded() {}

func (i *objectCacheItem) startReflector() {}

type cacheStore

func (c *cacheStore) Replace(list []interface{}

func (c *cacheStore) hasSynced() bool {}

func (c *cacheStore) unsetInitialized() {}

type objectCache

const minIdleTime

// NewObjectCache returns a new watch-based instance of Store interface.
func NewObjectCache(
	listObject listObjectFunc,
	watchObject watchObjectFunc,
	newObject newObjectFunc,
	isImmutable isImmutableFunc,
	groupResource schema.GroupResource,
	clock clock.Clock,
	maxIdleTime time.Duration,
	stopCh <-chan struct{}

func (c *objectCache) newStore() *cacheStore {}

func (c *objectCache) newReflectorLocked(namespace, name string) *objectCacheItem {}

func (c *objectCache) AddReference(namespace, name string, referencedFrom types.UID) {}

func (c *objectCache) DeleteReference(namespace, name string, referencedFrom types.UID) {}

// key returns key of an object with a given name and namespace.
// This has to be in-sync with cache.MetaNamespaceKeyFunc.
func (c *objectCache) key(namespace, name string) string {}

func (c *objectCache) isStopped() bool {}

func (c *objectCache) Get(namespace, name string) (runtime.Object, error) {}

func (c *objectCache) startRecycleIdleWatch() {}

func (c *objectCache) shutdownWhenStopped(stopCh <-chan struct{}

// NewWatchBasedManager creates a manager that keeps a cache of all objects
// necessary for registered pods.
// It implements the following logic:
//   - whenever a pod is created or updated, we start individual watches for all
//     referenced objects that aren't referenced from other registered pods
//   - every GetObject() returns a value from local cache propagated via watches
func NewWatchBasedManager(
	listObject listObjectFunc,
	watchObject watchObjectFunc,
	newObject newObjectFunc,
	isImmutable isImmutableFunc,
	groupResource schema.GroupResource,
	resyncInterval time.Duration,
	getReferencedObjects func(*v1.Pod) sets.Set[string]) Manager {}