Documentation
¶
Index ¶
- type IndexAllocator
- func (s *IndexAllocator) AssignIndex(podName string) (int, error)
- func (s *IndexAllocator) AsyncCheckNodeIndexAvailableAndAssign(pod *v1.Pod, index int)
- func (s *IndexAllocator) CheckNodeIndexAndTryOccupy(pod *v1.Pod, index int) bool
- func (s *IndexAllocator) ReconcileLockState(pod *v1.Pod)
- func (s *IndexAllocator) RemoveNodeIndexQueueForPod(namespacedName types.NamespacedName)
- func (s *IndexAllocator) SetReady()
- func (s *IndexAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) <-chan struct{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexAllocator ¶
type IndexAllocator struct {
IsLeader bool
Client client.Client
// contains filtered or unexported fields
}
IndexAllocator manages allocation of 1-128 temporary indices for Pod-to-DevicePlugin communication Uses a simple atomic counter that increments from 1 to 128, then wraps around to 1 No bitmap tracking needed - index reuse is acceptable after 128 cycles The availability check will be at PostBind stage, detected by pod index annotation on Node level
func NewIndexAllocator ¶
func (*IndexAllocator) AssignIndex ¶
func (s *IndexAllocator) AssignIndex(podName string) (int, error)
AssignIndex assigns a temporary index (1-128) for Pod-to-DevicePlugin communication Uses atomic increment to ensure thread-safe assignment Index wraps around from 128 to 1 (simple modulo operation)
func (*IndexAllocator) AsyncCheckNodeIndexAvailableAndAssign ¶ added in v1.55.0
func (s *IndexAllocator) AsyncCheckNodeIndexAvailableAndAssign(pod *v1.Pod, index int)
func (*IndexAllocator) CheckNodeIndexAndTryOccupy ¶ added in v1.55.0
func (s *IndexAllocator) CheckNodeIndexAndTryOccupy(pod *v1.Pod, index int) bool
func (*IndexAllocator) ReconcileLockState ¶ added in v1.55.0
func (s *IndexAllocator) ReconcileLockState(pod *v1.Pod)
ReconcileLockState maintains memory state for node level index assign and release queue
func (*IndexAllocator) RemoveNodeIndexQueueForPod ¶ added in v1.55.0
func (s *IndexAllocator) RemoveNodeIndexQueueForPod(namespacedName types.NamespacedName)
func (*IndexAllocator) SetReady ¶ added in v1.55.0
func (s *IndexAllocator) SetReady()
func (*IndexAllocator) SetupWithManager ¶
func (s *IndexAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) <-chan struct{}