Documentation
¶
Index ¶
Constants ¶
View Source
const ( IndexRangeStart = 1 IndexRangeEnd = 512 )
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-512 temporary indices for Pod-to-DevicePlugin communication Uses a simple atomic counter that increments from 1 to 512, then wraps around to 1 No bitmap tracking needed - index reuse is acceptable after 512 cycles
func NewIndexAllocator ¶
func (*IndexAllocator) AssignIndex ¶
func (s *IndexAllocator) AssignIndex(podName string) (int, error)
AssignIndex assigns a temporary index (1-512) for Pod-to-DevicePlugin communication Uses atomic increment to ensure thread-safe assignment Index wraps around from 512 to 1 (simple modulo operation)
func (*IndexAllocator) SetupWithManager ¶
func (s *IndexAllocator) SetupWithManager(ctx context.Context, mgr manager.Manager) <-chan struct{}
Click to show internal directories.
Click to hide internal directories.