indexallocator

package
v1.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 NewIndexAllocator(ctx context.Context, client client.Client) (*IndexAllocator, error)

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{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL