Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct { // Data is a serialized PodResourceAllocationInfo Data string `json:"data"` // Checksum is a checksum of Data Checksum checksum.Checksum `json:"checksum"` }
Checkpoint represents a structure to store pod resource allocation checkpoint data
func NewCheckpoint ¶
func NewCheckpoint(allocations *PodResourceCheckpointInfo) (*Checkpoint, error)
NewCheckpoint creates a new checkpoint from a list of claim info states
func (*Checkpoint) GetPodResourceCheckpointInfo ¶
func (cp *Checkpoint) GetPodResourceCheckpointInfo() (*PodResourceCheckpointInfo, error)
GetPodResourceCheckpointInfo returns Pod Resource Allocation info states from checkpoint
func (*Checkpoint) MarshalCheckpoint ¶
func (cp *Checkpoint) MarshalCheckpoint() ([]byte, error)
func (*Checkpoint) UnmarshalCheckpoint ¶
func (cp *Checkpoint) UnmarshalCheckpoint(blob []byte) error
UnmarshalCheckpoint unmarshals checkpoint from JSON
func (*Checkpoint) VerifyChecksum ¶
func (cp *Checkpoint) VerifyChecksum() error
VerifyChecksum verifies that current checksum of checkpointed Data is valid
type PodResourceCheckpointInfo ¶
type PodResourceCheckpointInfo struct {
Entries PodResourceInfoMap `json:"entries,omitempty"`
}
type PodResourceInfo ¶
type PodResourceInfo struct { // ContainerResources maps container names to their respective ResourceRequirements. ContainerResources map[string]v1.ResourceRequirements }
PodResourceInfo stores resource requirements for containers within a pod.
type PodResourceInfoMap ¶
type PodResourceInfoMap map[types.UID]PodResourceInfo
PodResourceInfoMap maps pod UIDs to their corresponding PodResourceInfo, tracking resource requirements for all containers within each pod.
func (PodResourceInfoMap) Clone ¶
func (pr PodResourceInfoMap) Clone() PodResourceInfoMap
Clone returns a copy of PodResourceInfoMap
type Reader ¶
type Reader interface { GetContainerResources(podUID types.UID, containerName string) (v1.ResourceRequirements, bool) GetPodResourceInfoMap() PodResourceInfoMap }
Reader interface used to read current pod resource state
type State ¶
type State interface { Reader // contains filtered or unexported methods }
State interface provides methods for tracking and setting pod resources
func NewNoopStateCheckpoint ¶
func NewNoopStateCheckpoint() State
NewNoopStateCheckpoint creates a dummy state checkpoint manager
func NewStateCheckpoint ¶
NewStateCheckpoint creates new State for keeping track of pod resource information with checkpoint backend
func NewStateMemory ¶
func NewStateMemory(resources PodResourceInfoMap) State
NewStateMemory creates new State to track resources resourcesated to pods