checkpoint

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: 10 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Data     checkpointData
	Checksum checksum.Checksum
}

Data holds checkpoint data and its checksum

func (*Data) GetDataInLatestFormat added in v1.20.14

func (cp *Data) GetDataInLatestFormat() ([]PodDevicesEntry, map[string][]string)

GetDataInLatestFormat returns device entries and registered devices in the *most recent* checkpoint format, *not* in the original format stored on disk.

func (*Data) MarshalCheckpoint

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

MarshalCheckpoint returns marshalled data

func (*Data) UnmarshalCheckpoint

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

UnmarshalCheckpoint returns unmarshalled data

func (*Data) VerifyChecksum

func (cp *Data) VerifyChecksum() error

VerifyChecksum verifies that passed checksum is same as calculated checksum

type DataV1 added in v1.20.14

type DataV1 struct {
	Data     checkpointDataV1
	Checksum checksum.Checksum
}

DataV1 holds checkpoint data and its checksum, in V1 (k8s <= 1.19) format

func (*DataV1) GetDataInLatestFormat added in v1.20.14

func (cp *DataV1) GetDataInLatestFormat() ([]PodDevicesEntry, map[string][]string)

GetDataInLatestFormat returns device entries and registered devices in the *most recent* checkpoint format, *not* in the original format stored on disk.

func (*DataV1) MarshalCheckpoint added in v1.20.14

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

MarshalCheckpoint is needed to implement the Checkpoint interface, but should not be called anymore

func (*DataV1) UnmarshalCheckpoint added in v1.20.14

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

UnmarshalCheckpoint returns unmarshalled data

func (*DataV1) VerifyChecksum added in v1.20.14

func (cp *DataV1) VerifyChecksum() error

VerifyChecksum verifies that passed checksum is same as calculated checksum

type DeviceManagerCheckpoint

type DeviceManagerCheckpoint interface {
	checkpointmanager.Checkpoint
	GetDataInLatestFormat() ([]PodDevicesEntry, map[string][]string)
}

DeviceManagerCheckpoint defines the operations to retrieve pod devices

func New

func New(devEntries []PodDevicesEntry, devices map[string][]string) DeviceManagerCheckpoint

New returns an instance of Checkpoint - must be an alias for the most recent version

func NewV1 added in v1.20.14

func NewV1(devEntries []PodDevicesEntryV1,
	devices map[string][]string) DeviceManagerCheckpoint

NewV1 returns an instance of Checkpoint, in V1 (k8s <= 1.19) format. Users should avoid creating checkpoints in formats different than the most recent one, use the old formats only to validate existing checkpoint and convert them to most recent format. The only exception should be test code.

type DevicesPerNUMA added in v1.20.0

type DevicesPerNUMA map[int64][]string

DevicesPerNUMA represents device ids obtained from device plugin per NUMA node id

func NewDevicesPerNUMA added in v1.20.0

func NewDevicesPerNUMA() DevicesPerNUMA

NewDevicesPerNUMA is a function that creates DevicesPerNUMA map

func (DevicesPerNUMA) Devices added in v1.20.0

func (dev DevicesPerNUMA) Devices() sets.String

Devices is a function that returns all device ids for all NUMA nodes and represent it as sets.String

type PodDevicesEntry

type PodDevicesEntry struct {
	PodUID        string
	ContainerName string
	ResourceName  string
	DeviceIDs     DevicesPerNUMA
	AllocResp     []byte
}

PodDevicesEntry connects pod information to devices

type PodDevicesEntryV1 added in v1.20.14

type PodDevicesEntryV1 struct {
	PodUID        string
	ContainerName string
	ResourceName  string
	DeviceIDs     []string
	AllocResp     []byte
}

PodDevicesEntryV1 connects pod information to devices, without topology information (k8s <= 1.19)

Jump to

Keyboard shortcuts

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