fix(doc): elaborate the documentation of SnapshotSharedLister

This commit is contained in:
Kensei Nakada 2023-11-23 08:19:26 +00:00
parent 1f07da7575
commit 4d9df1134f

View File

@ -648,11 +648,17 @@ type Handle interface {
PluginsRunner
// SnapshotSharedLister returns listers from the latest NodeInfo Snapshot. The snapshot
// is taken at the beginning of a scheduling cycle and remains unchanged until
// a pod finishes "Permit" point. There is no guarantee that the information
// remains unchanged in the binding phase of scheduling, so plugins in the binding
// cycle (pre-bind/bind/post-bind/un-reserve plugin) should not use it,
// otherwise a concurrent read/write error might occur, they should use scheduler
// cache instead.
// a pod finishes "Permit" point.
//
// It should be used only during scheduling cycle:
// - There is no guarantee that the information remains unchanged in the binding phase of scheduling.
// So, plugins shouldn't use it in the binding cycle (pre-bind/bind/post-bind/un-reserve plugin)
// otherwise, a concurrent read/write error might occur.
// - There is no guarantee that the information is always up-to-date.
// So, plugins shouldn't use it in QueueingHint and PreEnqueue
// otherwise, they might make a decision based on stale information.
//
// Instead, they should use the resources getting from Informer created from SharedInformerFactory().
SnapshotSharedLister() SharedLister
// IterateOverWaitingPods acquires a read lock and iterates over the WaitingPods map.