controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package controller implements the node-local control loop inside snapshot-agent. It does not own CRDs or replace the operator. Instead it watches pod, job, and lease state on the current node and delegates CRIU/CUDA execution to the snapshot executor workflows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckpointParams

type CheckpointParams struct {
	// Pod is the live source pod (already provenance-verified by the reconciler).
	Pod *corev1.Pod
	// ContainerName is the single target container to checkpoint.
	ContainerName string
	// ContainerID is the agent-resolved running container ID (CRI scheme stripped).
	ContainerID string
	// ContainerPID is the agent-resolved host PID of the running container.
	ContainerPID int
	// ContentUID is the immutable PodSnapshotContent identity owning the artifact.
	ContentUID string
	// HostPath is the agent-resolved destination directory for the dump.
	HostPath string
	// StartedAt marks when the controller observed the work order, for timing.
	StartedAt time.Time
}

CheckpointParams carries everything the node driver needs to dump one container.

type NodeController

type NodeController struct {
	// contains filtered or unexported fields
}

NodeController watches local-node pods with checkpoint metadata and reconciles snapshot execution for checkpoint and restore requests. The restore path is driven by a client-go pod informer; the capture path is driven by a dynamic informer over PodSnapshotContent work orders filtered to this node, with typed reads/writes via an uncached controller-runtime client.

func NewNodeController

func NewNodeController(
	cfg *types.AgentConfig,
	rt snapshotruntime.Runtime,
	log logr.Logger,
) (*NodeController, error)

NewNodeController creates the node-local controller that runs inside snapshot-agent.

func (*NodeController) Run

func (w *NodeController) Run(ctx context.Context) error

Run starts the local pod informers and processes checkpoint/restore events.

Jump to

Keyboard shortcuts

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