package state
import "k8s.io/kubernetes/pkg/kubelet/cm/dra/state"
Index ¶
- Constants
- type Checkpoint
- func NewCheckpoint(data ClaimInfoStateList) (*Checkpoint, error)
- func (cp *Checkpoint) GetClaimInfoStateList() (ClaimInfoStateList, error)
- func (cp *Checkpoint) MarshalCheckpoint() ([]byte, error)
- func (cp *Checkpoint) UnmarshalCheckpoint(blob []byte) error
- func (cp *Checkpoint) VerifyChecksum() error
- type CheckpointData
- type Checkpointer
- type ClaimInfoState
- func (in *ClaimInfoState) DeepCopy() *ClaimInfoState
- func (in *ClaimInfoState) DeepCopyInto(out *ClaimInfoState)
- type ClaimInfoStateList
- type Device
- type DriverState
Constants ¶
const ( CheckpointAPIGroup = "checkpoint.dra.kubelet.k8s.io" CheckpointKind = "DRACheckpoint" CheckpointAPIVersion = CheckpointAPIGroup + "/v1" )
Types ¶
type Checkpoint ¶
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 ¶
func NewCheckpoint(data ClaimInfoStateList) (*Checkpoint, error)
NewCheckpoint creates a new checkpoint from a list of claim info states
func (*Checkpoint) GetClaimInfoStateList ¶
func (cp *Checkpoint) GetClaimInfoStateList() (ClaimInfoStateList, error)
GetClaimInfoStateList returns list of claim info states from checkpoint
func (*Checkpoint) MarshalCheckpoint ¶
func (cp *Checkpoint) MarshalCheckpoint() ([]byte, error)
MarshalCheckpoint marshals checkpoint to JSON
func (*Checkpoint) UnmarshalCheckpoint ¶
func (cp *Checkpoint) UnmarshalCheckpoint(blob []byte) error
UnmarshalCheckpoint unmarshals checkpoint from JSON and verifies its data checksum
func (*Checkpoint) VerifyChecksum ¶
func (cp *Checkpoint) VerifyChecksum() error
VerifyChecksum verifies that current checksum of checkpointed Data is valid
type CheckpointData ¶
type CheckpointData struct {
metav1.TypeMeta
ClaimInfoStateList ClaimInfoStateList
}
type Checkpointer ¶
type Checkpointer interface {
GetOrCreate() (*Checkpoint, error)
Store(*Checkpoint) error
}
func NewCheckpointer ¶
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 ¶
func (in *ClaimInfoState) DeepCopy() *ClaimInfoState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClaimInfoState.
func (*ClaimInfoState) DeepCopyInto ¶
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 ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
func (*Device) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type DriverState ¶
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 ¶
func (in *DriverState) DeepCopy() *DriverState
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverState.
func (*DriverState) DeepCopyInto ¶
func (in *DriverState) DeepCopyInto(out *DriverState)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Source Files ¶
checkpoint.go checkpointer.go state.go zz_generated.deepcopy.go
- Version
- v1.32.0-rc.1
- Published
- Dec 3, 2024
- Platform
- darwin/amd64
- Imports
- 10 packages
- Last checked
- 6 minutes ago –
Tools for package owners.