kubernetesk8s.io/kubernetes/pkg/kubelet/cm/dra/state Index | Files

package state

import "k8s.io/kubernetes/pkg/kubelet/cm/dra/state"

Index

Functions

func NewCheckpointState

func NewCheckpointState(stateDir, checkpointName string) (*stateCheckpoint, error)

NewCheckpointState creates new State for keeping track of claim info with checkpoint backend

Types

type CheckpointState

type CheckpointState interface {
	GetOrCreate() (ClaimInfoStateList, error)
	Store(ClaimInfoStateList) error
}

CheckpointState interface provides to get and store state

type ClaimInfoState

type ClaimInfoState struct {
	// Name of the DRA driver
	DriverName string

	// ClassName is a resource class of the claim
	ClassName string

	// ClaimUID is an UID of the resource claim
	ClaimUID types.UID

	// ClaimName is a name of the resource claim
	ClaimName string

	// Namespace is a claim namespace
	Namespace string

	// PodUIDs is a set of pod UIDs that reference a resource
	PodUIDs sets.Set[string]

	// ResourceHandles is a list of opaque resource data for processing by a specific kubelet plugin
	ResourceHandles []resourcev1alpha2.ResourceHandle

	// CDIDevices is a map of DriverName --> CDI devices returned by the
	// GRPC API call NodePrepareResource
	CDIDevices map[string][]string
}

ClaimInfoState is used to store claim info state in a checkpoint

type ClaimInfoStateList

type ClaimInfoStateList []ClaimInfoState

List of claim info to store in checkpoint

type ClaimInfoStateListWithoutResourceHandles

type ClaimInfoStateListWithoutResourceHandles []ClaimInfoStateWithoutResourceHandles

List of claim info to store in checkpoint TODO: remove in Beta

type ClaimInfoStateWithoutResourceHandles

type ClaimInfoStateWithoutResourceHandles struct {
	// Name of the DRA driver
	DriverName string

	// ClassName is a resource class of the claim
	ClassName string

	// ClaimUID is an UID of the resource claim
	ClaimUID types.UID

	// ClaimName is a name of the resource claim
	ClaimName string

	// Namespace is a claim namespace
	Namespace string

	// PodUIDs is a set of pod UIDs that reference a resource
	PodUIDs sets.Set[string]

	// CDIDevices is a map of DriverName --> CDI devices returned by the
	// GRPC API call NodePrepareResource
	CDIDevices map[string][]string
}

ClaimInfoStateWithoutResourceHandles is an old implementation of the ClaimInfoState TODO: remove in Beta

type DRAManagerCheckpoint

type DRAManagerCheckpoint struct {
	Version  string             `json:"version"`
	Entries  ClaimInfoStateList `json:"entries,omitempty"`
	Checksum checksum.Checksum  `json:"checksum"`
}

DRAManagerCheckpoint struct is used to store pod dynamic resources assignments in a checkpoint

func NewDRAManagerCheckpoint

func NewDRAManagerCheckpoint() *DRAManagerCheckpoint

NewDRAManagerCheckpoint returns an instance of Checkpoint

func (*DRAManagerCheckpoint) MarshalCheckpoint

func (dc *DRAManagerCheckpoint) MarshalCheckpoint() ([]byte, error)

MarshalCheckpoint returns marshalled checkpoint

func (*DRAManagerCheckpoint) UnmarshalCheckpoint

func (dc *DRAManagerCheckpoint) UnmarshalCheckpoint(blob []byte) error

UnmarshalCheckpoint tries to unmarshal passed bytes to checkpoint

func (*DRAManagerCheckpoint) VerifyChecksum

func (dc *DRAManagerCheckpoint) VerifyChecksum() error

VerifyChecksum verifies that current checksum of checkpoint is valid

type DRAManagerCheckpointWithoutResourceHandles

type DRAManagerCheckpointWithoutResourceHandles struct {
	Version  string                                   `json:"version"`
	Entries  ClaimInfoStateListWithoutResourceHandles `json:"entries,omitempty"`
	Checksum checksum.Checksum                        `json:"checksum"`
}

DraManagerCheckpoint struct is an old implementation of the DraManagerCheckpoint

Source Files

checkpoint.go state_checkpoint.go

Version
v1.30.1
Published
May 14, 2024
Platform
js/wasm
Imports
12 packages
Last checked
4 minutes ago

Tools for package owners.