state

package
v1.31.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckpointAPIGroup   = "checkpoint.dra.kubelet.k8s.io"
	CheckpointKind       = "DRACheckpoint"
	CheckpointAPIVersion = CheckpointAPIGroup + "/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkpoint added in v1.31.0

type Checkpoint struct {
	// Data is a JSON serialized checkpoint data
	Data string
	// Checksum is a checksum of Data
	Checksum uint32
}

Checkpoint represents a structure to store DRA checkpoint data

func NewCheckpoint added in v1.31.0

func NewCheckpoint(data ClaimInfoStateList) (*Checkpoint, error)

NewCheckpoint creates a new checkpoint from a list of claim info states

func (*Checkpoint) GetClaimInfoStateList added in v1.31.0

func (cp *Checkpoint) GetClaimInfoStateList() (ClaimInfoStateList, error)

GetClaimInfoStateList returns list of claim info states from checkpoint

func (*Checkpoint) MarshalCheckpoint added in v1.31.0

func (cp *Checkpoint) MarshalCheckpoint() ([]byte, error)

MarshalCheckpoint marshals checkpoint to JSON

func (*Checkpoint) UnmarshalCheckpoint added in v1.31.0

func (cp *Checkpoint) UnmarshalCheckpoint(blob []byte) error

UnmarshalCheckpoint unmarshals checkpoint from JSON and verifies its data checksum

func (*Checkpoint) VerifyChecksum added in v1.31.0

func (cp *Checkpoint) VerifyChecksum() error

VerifyChecksum verifies that current checksum of checkpointed Data is valid

type CheckpointData added in v1.31.0

type CheckpointData struct {
	metav1.TypeMeta
	ClaimInfoStateList ClaimInfoStateList
}

type Checkpointer added in v1.31.0

type Checkpointer interface {
	GetOrCreate() (*Checkpoint, error)
	Store(*Checkpoint) error
}

func NewCheckpointer added in v1.31.0

func NewCheckpointer(stateDir, checkpointName string) (Checkpointer, error)

NewCheckpointer creates new checkpointer for keeping track of claim info with checkpoint backend

type ClaimInfoState

type ClaimInfoState struct {
	// ClaimUID is the UID of a resource claim
	ClaimUID types.UID

	// ClaimName is the name of a 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]

	// DriverState contains information about all drivers which have allocation
	// results in the claim, even if they don't provide devices for their results.
	DriverState map[string]DriverState
}

+k8s:deepcopy-gen=true

func (*ClaimInfoState) DeepCopy added in v1.31.0

func (in *ClaimInfoState) DeepCopy() *ClaimInfoState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimInfoState.

func (*ClaimInfoState) DeepCopyInto added in v1.31.0

func (in *ClaimInfoState) DeepCopyInto(out *ClaimInfoState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClaimInfoStateList

type ClaimInfoStateList []ClaimInfoState

type Device added in v1.31.0

type Device struct {
	PoolName     string
	DeviceName   string
	RequestNames []string
	CDIDeviceIDs []string
}

Device is how a DRA driver described an allocated device in a claim to kubelet. RequestName and CDI device IDs are optional. +k8s:deepcopy-gen=true

func (*Device) DeepCopy added in v1.31.0

func (in *Device) DeepCopy() *Device

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.

func (*Device) DeepCopyInto added in v1.31.0

func (in *Device) DeepCopyInto(out *Device)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DriverState added in v1.31.0

type DriverState struct {
	Devices []Device
}

DriverState is used to store per-device claim info state in a checkpoint +k8s:deepcopy-gen=true

func (*DriverState) DeepCopy added in v1.31.0

func (in *DriverState) DeepCopy() *DriverState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverState.

func (*DriverState) DeepCopyInto added in v1.31.0

func (in *DriverState) DeepCopyInto(out *DriverState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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