metadata

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// container archive
	ConfigDumpFile             = "config.dump"
	SpecDumpFile               = "spec.dump"
	NetworkStatusFile          = "network.status"
	CheckpointDirectory        = "checkpoint"
	CheckpointVolumesDirectory = "volumes"
	DevShmCheckpointTar        = "devshm-checkpoint.tar"
	RootFsDiffTar              = "rootfs-diff.tar"
	DeletedFilesFile           = "deleted.files"
	DumpLogFile                = "dump.log"
	RestoreLogFile             = "restore.log"
	// pod archive
	PodOptionsFile = "pod.options"
	PodDumpFile    = "pod.dump"
	// containerd only
	StatusFile = "status"
	// CRIU Images
	PagesPrefix       = "pages-"
	AmdgpuPagesPrefix = "amdgpu-pages-"
)

Variables

This section is empty.

Functions

func ByteToString

func ByteToString(b int64) string

func ReadContainerCheckpointDeletedFiles

func ReadContainerCheckpointDeletedFiles(checkpointDirectory string) ([]string, string, error)

func ReadContainerCheckpointSpecDump

func ReadContainerCheckpointSpecDump(checkpointDirectory string) (*spec.Spec, string, error)

func ReadJSONFile

func ReadJSONFile(v interface{}, dir, file string) (string, error)

func WriteJSONFile

func WriteJSONFile(v interface{}, dir, file string) (string, error)

WriteJSONFile marshalls and writes the given data to a JSON file

Types

type ContainerConfig

type ContainerConfig struct {
	ID              string    `json:"id"`
	Name            string    `json:"name"`
	RootfsImage     string    `json:"rootfsImage,omitempty"`
	RootfsImageRef  string    `json:"rootfsImageRef,omitempty"`
	RootfsImageName string    `json:"rootfsImageName,omitempty"`
	OCIRuntime      string    `json:"runtime,omitempty"`
	CreatedTime     time.Time `json:"createdTime"`
	CheckpointedAt  time.Time `json:"checkpointedTime"`
	RestoredAt      time.Time `json:"restoredTime"`
	Restored        bool      `json:"restored"`
}

This is a reduced copy of what Podman uses to store checkpoint metadata

func ReadContainerCheckpointConfigDump

func ReadContainerCheckpointConfigDump(checkpointDirectory string) (*ContainerConfig, string, error)

type ContainerdStatus

type ContainerdStatus struct {
	CreatedAt  int64
	StartedAt  int64
	FinishedAt int64
	ExitCode   int32
	Pid        uint32
	Reason     string
	Message    string
}

func ReadContainerCheckpointStatusFile

func ReadContainerCheckpointStatusFile(checkpointDirectory string) (*ContainerdStatus, string, error)

type KubernetesCheckpoint

type KubernetesCheckpoint struct {
	Archive   string `json:"archive,omitempty"`
	Size      int64  `json:"size,omitempty"`
	Timestamp int64  `json:"timestamp,omitempty"`
}

This structure is used by the KubernetesContainerCheckpointMetadata structure

type KubernetesContainerCheckpointMetadata

type KubernetesContainerCheckpointMetadata struct {
	PodFullName   string                 `json:"podFullName,omitempty"`
	ContainerName string                 `json:"containerName,omitempty"`
	TotalSize     int64                  `json:"totalSize,omitempty"`
	Checkpoints   []KubernetesCheckpoint `json:"checkpoints"`
}

This structure is the basis for Kubernetes to track how many checkpoints for a certain container have been created.

Jump to

Keyboard shortcuts

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