Skip to main content

Module layer_sync

Module layer_sync 

Source
Expand description

Shared, content-agnostic splitdirfdstream producer and consumer for layer synchronisation.

This module holds the blocking logic for producing a splitdirfdstream from a stored layer and for draining one back into a repository. It depends only on the (tiny) composefs-splitdirfdstream crate, not the containers-storage / podman stack, so it is always compiled — including in builds that do not enable the containers-storage feature.

Callers:

  • crates/composefs-oci/src/cstor.rs — the containers-storage import path (only built with the containers-storage feature).
  • composefs-ctl varlink server — repo-to-repo layer synchronisation via GetLayer/PutLayer, and the oci copy command.

Enums§

VerifiedDrainError
Errors returned by the diff-id-verifying drain path.

Functions§

drain_splitdirfdstream
Drain the splitdirfdstream pipe and write the resulting layer splitstream.
drain_splitdirfdstream_verified
Like drain_splitdirfdstream, but additionally verifies that the reconstructed (uncompressed tar) content hashes to diff_id, and only commits the layer splitstream to the repository if it matches.
finalize_oci_image
Finalize an OCI image whose layers are already imported into repo.
process_file_content
Store the content of one file fd into the splitstream, choosing inline vs external storage based on the file size.
produce_layer_splitdirfdstream
Produce a splitdirfdstream for the layer splitstream identified by layer_verity, writing it to out.

Type Aliases§

FinalizeResult
A type alias for the (manifest, config) digest-and-verity pair returned by finalize_oci_image.