restoreproxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package restoreproxy is the PID 1 of a restore destination container. It waits for the agent to finish the restore, then follows the restored process and exits with its status, so the container's lifecycle is the workload's.

Index

Constants

View Source
const DefaultPollInterval = 5 * time.Second

DefaultPollInterval backs up inotify. It only matters when a watch event is lost, so it is slow.

Variables

ForwardedSignals are passed on to the restored process. SIGKILL and SIGSTOP cannot be caught, so kubelet's final SIGKILL takes the whole container down.

Functions

func ControlDirFromEnv

func ControlDirFromEnv() string

ControlDirFromEnv resolves the control directory the restore Pod contract mounts into the container.

func Run

func Run(cfg Config) int

Run waits for the restore and follows the restored process. It returns the container's exit code. It never deletes the control files: an emptyDir survives a container restart, and a file left by an earlier container is how a restarted proxy knows the Pod's one restore is spent.

Types

type Config

type Config struct {
	// ControlDir holds RestoreCompleteFile and RestoreFailedFile.
	ControlDir string
	// ProcRoot is normally /proc. The restored PID is read relative to it.
	ProcRoot string
	// Signals delivers the ForwardedSignals the caller subscribed to.
	Signals <-chan os.Signal
	// PollInterval backs up inotify while waiting for the restore.
	PollInterval time.Duration
	Log          logr.Logger
}

Config is what Run needs from the process around it.

Jump to

Keyboard shortcuts

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