Module store

Module store 

Source
Expand description

APIs for storing (layered) container images as OSTree commits

Β§Extension of encapsulation support

This code supports ingesting arbitrary layered container images from an ostree-exported base. See encapsulate for more information on encapsulation of images.

StructsΒ§

CachedImageUpdate
Locally cached metadata for an update to an existing image.
CompareState πŸ”’
ExportToOCIOpts
Options controlling commit export into OCI
ImageImporter
Context for importing a container image.
ImageProxyConfig
Configuration for the proxy.
LayerProgress
Sent across a channel to track the byte-level progress of a layer fetch.
LayeredImageState
State of an already pulled layered image.
ManifestLayerState
A container image layer with associated downloaded-or-not state.
PreparedImport
Information about which layers need to be downloaded.

EnumsΒ§

ImportProgress
Sent across a channel to track start and end of a container fetch.
PrepareResult
Result of invoking ImageImporter::prepare.

ConstantsΒ§

BASE_IMAGE_PREFIX
The ostree ref prefix for β€œbase” image references that are used by derived images. If you maintain tooling which is locally building derived commits, write a ref with this prefix that is owned by your code. It’s a best practice to prefix the ref with the project name, so the final ref may be of the form e.g. ostree/container/baseimage/bootc/foo.
IMAGE_PREFIX πŸ”’
The ostree ref prefix for image references.
LAYER_PREFIX πŸ”’
The ostree ref prefix for blobs.
META_CONFIG πŸ”’
The key injected into the merge commit with the image configuration serialized as JSON.
META_MANIFEST πŸ”’
The key injected into the merge commit with the manifest serialized as JSON.
META_MANIFEST_DIGEST πŸ”’
The key injected into the merge commit for the manifest digest.
OSTREE_BASE_DEPLOYMENT_REFS πŸ”’
The ref prefixes which point to ostree deployments. (TODO: Add an official API for this)
RPMOSTREE_BASE_REFS πŸ”’
A layering violation we’ll carry for a bit to band-aid over https://github.com/coreos/rpm-ostree/issues/4185

FunctionsΒ§

chunking_from_layer_committed πŸ”’
The way we store β€œchunk” layers in ostree is by writing a commit whose filenames are their own object identifier. This function parses what is written by the ImporterMode::ObjectSet logic, turning it back into a β€œchunked” structure that is used by the export code.
cleanup_root πŸ”’
Automatically clean up files that may have been injected by container builds. xref https://github.com/containers/buildah/issues/4242
clear_cached_update
Remove any cached
compare_commit_trees πŸ”’
compare_file_info πŸ”’
copy
Copy a downloaded image from one repository to another, while also optionally changing the image reference type.
export
Given a container image reference which is stored in repo, export it to the target image location.
export_to_oci πŸ”’
Export an imported container image to a target OCI directory.
gc_image_layers
Garbage collect unused image layer references.
gc_image_layers_impl πŸ”’
image_config_from_commitmeta πŸ”’
image_filtered_content_warning
Generate a suitable warning message from given list of filtered files, if any.
inode_of_object πŸ”’
layer_from_diffid πŸ”’
Given a target diffid, return its corresponding layer. In our current model, we require a 1-to-1 mapping between the two up until the ostree level. For a bit more information on this, see https://github.com/opencontainers/image-spec/blob/main/config.md
list_container_deployment_manifests πŸ”’
Iterate over deployment commits, returning the manifests from commits which point to a container image.
list_images
List all images stored
manifest_data_from_commitmeta πŸ”’
manifest_digest_from_commit
Return the original digest of the manifest stored in the commit metadata. This will be a string of the form e.g. sha256:<digest>.
manifest_for_image πŸ”’
parse_cached_update πŸ”’
Given detached commit metadata, parse the data that we serialized for a pending update (if any).
parse_manifest_layout πŸ”’
parse_ostree_manifest_layout πŸ”’
Like parse_manifest_layout but requires the image has an ostree base.
query_image
Query metadata for a pulled image.
query_image_commit
Query metadata for a pulled image via an OSTree commit digest. The digest must refer to a pulled container image’s merge commit.
query_layer πŸ”’
ref_for_blob_digest πŸ”’
Convert e.g. sha256:12345… into /ostree/container/blob/sha256_2B12345....
ref_for_image πŸ”’
Convert e.g. sha256:12345… into /ostree/container/blob/sha256_2B12345....
ref_for_layer πŸ”’
Convert e.g. sha256:12345… into /ostree/container/blob/sha256_2B12345....
remove_image
Remove the specified image reference. If the image is already not present, this function will successfully perform no operation.
remove_images
Remove the specified image references. If an image is not found, further images will be removed, but an error will be returned.
timestamp_of_manifest_or_config πŸ”’
Find the timestamp of the manifest (or config), ignoring errors.
try_query_image πŸ”’
Attempt to query metadata for a pulled image; if it is corrupted, the error is printed to stderr and None is returned.
verify_container_image πŸ”’

Type AliasesΒ§

MetaFilteredData
The type used to store content filtering information.