Documentation
¶
Overview ¶
Package overlay provides shared helpers for restoring a container's overlayfs RW (upper) layer from a dump.
It lives in the parent module so that runc plugin, the containerd plugin, and the containerd runtime shim (cedana-containerd-runtime) can all use it.
The Linux overlayfs contract states that modifying the underlying upper/lower directories of a *mounted* overlay is undefined behavior Therefore the RW layer must be restored into the upperdir *before* the overlay is mounted:
- Kubernetes pods: the containerd shim (cedana-containerd-runtime) populates the upperdir just before it mounts the rootfs.
- CLI `cedana restore`: the containerd plugin populates the freshly-prepared snapshot's upperdir before NewTask mounts it.
Both drop a marker so the runc plugin's post-mount restore is a no-op.
Index ¶
Constants ¶
const RestoredMarker = ".cedana-rw-restored"
RestoredMarker is dropped in the snapshot directory (the parent of the upperdir, which is outside the overlay's merged view and therefore invisible to the container) once the RW layer has been restored. Its presence tells a later, redundant restore attempt to skip and avoid a double-populate.
Variables ¶
This section is empty.
Functions ¶
func AlreadyRestored ¶
func MarkerPath ¶
func RestoreToUpperDir ¶
RestoreToUpperDir reads the RW-layer batches from the dump filesystem and writes them into upperDir. No-op if dump has no RW-layer manifest
func UpperDirFromMountOptions ¶
UpperDirFromMountOptions extracts the upperdir from a set of overlay mount options
func WriteMarker ¶
WriteMarker records that the RW layer for the given upperdir has been restored.
Types ¶
This section is empty.