state

package
v1.28.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 added in v1.28.0

type ClaimInfoStateListWithoutResourceHandles []ClaimInfoStateWithoutResourceHandles

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

type ClaimInfoStateWithoutResourceHandles added in v1.28.0

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 added in v1.28.0

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

Jump to

Keyboard shortcuts

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