state

package
v1.27.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 8 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]

	// 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 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

Jump to

Keyboard shortcuts

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