Merge pull request #122017 from sanposhiho/doc-shared-lister

fix(doc): elaborate the documentation of SnapshotSharedLister
This commit is contained in:
Kubernetes Prow Robot 2023-12-14 05:09:52 +01:00 committed by GitHub
commit f708c47469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -650,11 +650,17 @@ type Handle interface {
PluginsRunner PluginsRunner
// SnapshotSharedLister returns listers from the latest NodeInfo Snapshot. The snapshot // SnapshotSharedLister returns listers from the latest NodeInfo Snapshot. The snapshot
// is taken at the beginning of a scheduling cycle and remains unchanged until // 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 // a pod finishes "Permit" point.
// 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, // It should be used only during scheduling cycle:
// otherwise a concurrent read/write error might occur, they should use scheduler // - There is no guarantee that the information remains unchanged in the binding phase of scheduling.
// cache instead. // 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 SnapshotSharedLister() SharedLister
// IterateOverWaitingPods acquires a read lock and iterates over the WaitingPods map. // IterateOverWaitingPods acquires a read lock and iterates over the WaitingPods map.